All Questions
9 questions
0
votes
1
answer
24
views
Replacing some elements in a variable
I have a txt file format. I have some problems about reading and replacing this file.
When I use:
mrk <- read.table("mrk.txt", skip = 1, colClasses = c("numeric","character") )
str(mrk)
'data....
0
votes
2
answers
2k
views
replace a string to number in a factor column
I have a df where the class of a column is factor. However, 80% of its values are numeric/integer/float and the 20% are string "No contact". How can I replace "No contact" with the value 0?.
I ...
0
votes
0
answers
199
views
How to substitute Binary values with Yes/ No in R Dataframe [duplicate]
I have the following dataframe
edge Phone new buy
0 0 0 1
0 0 0 1
0 0 0 1
0 0 0 1
I wish to replace the ones with "yes" and Two's's ...
0
votes
3
answers
3k
views
Replace all string values to '1' [duplicate]
I have a dataframe in R in which all cells either contain '0' or a word (short string of 4-6 letters). I would like to replace all these string values to '1'. I see a lot of options replacing specific ...
3
votes
4
answers
124
views
pandas keep numerical part
I have a set of data like:
0 1
0 type 1 type 2
1 type 3 type 4
How can I transfer it to:
0 1
0 1 2
1 3 4
perfer using applyor transform function
2
votes
1
answer
2k
views
SPSS replace missing values
I have some data with 15 variables, including some missing values. When I tried to look at the Frequency charts with the count and percentages of missing values, it was showing all variables without ...
1
vote
3
answers
9k
views
Invalid Factor Level, NA generated R
Sample of the data I am working with below. I already omitted all rows with a "NA" in them.
gss.s[1:5,]
abany advfront arrest
2 YES Agree NO
3 YES ...
0
votes
2
answers
552
views
How to replace a numeric character with empty character in C#?
I have string like
1 69 / EMP1094467 EMP1094467 : 2 69 / ScreenLysP
here the numeric characters should be replace with empty characters, Llike:
/ EMP1094467
I tried like this
var output = ...
3
votes
3
answers
547
views
Strrep not working in Matlab to make String into function
Hello I am new to MATLAB , I wanted to know how can I make my string into function . I want to access the function as a string from user in standard Matlab format (e.g exp(-10*X)-sin(pi*X)-2*tanh(X) ) ...