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
--
View this message in context:
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 -
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
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
4 matches
Mail list logo