Re: [R] replacing a value

2022-04-05 Thread Jim Lemon
Hi Ani, It seems to work for me: a<-c(20, 20, 14.2375646029948, 19.9, 20, 20, 16.3092078677214, 20, 20, 20, 20, 20, 20, 20, 20, 14.8590932408795, 16.178935255298, 20, 20, 20, 20, 27.6404077886079, 20, 20, 20, 20, 20, 21.9857063037444, 20, 20, 20, 20) > a==20 [1] TRUE TRUE FALSE FALS

Re: [R] Replacing a value in a dataframe

2011-11-30 Thread Uwe Ligges
On 30.11.2011 12:26, Bert Gunter wrote: er... Uwe, shouldn't that be, e.g. dataframe$Cheque<- as.integer(dataframe$Cheque) Sure, thanks. ## or building on Rolf's suggestion dataframe<- within(dataframe, Cheque<- as.integer(Cheque)) While I am at it, is there any practical difference in

Re: [R] Replacing a value in a dataframe

2011-11-30 Thread Bert Gunter
er... Uwe, shouldn't that be, e.g. dataframe$Cheque <- as.integer(dataframe$Cheque) ## or building on Rolf's suggestion dataframe <- within(dataframe, Cheque <- as.integer(Cheque)) While I am at it, is there any practical difference in efficiency between these two approaches? -- Bert 2011/11

Re: [R] Replacing a value in a dataframe

2011-11-30 Thread Uwe Ligges
On 30.11.2011 09:16, arunkumar wrote: hi I have data like this in a dataframe Var Value Cheque X140FALSE X220FALSE X328TRUE I want to replace it FLASE with 0 and TRUE with 1. is there any method by which i can do without using LOOP dataframe$Cheque <- as.int