Skip to content
Back to formatted view

Raw Message

Message-ID: <4ED5FBA1.4050908@statistik.tu-dortmund.de>
Date: 2011-11-30T09:47:13Z
From: Uwe Ligges
Subject: Replacing a value in a dataframe
In-Reply-To: <1322640999899-4122188.post@n4.nabble.com>

On 30.11.2011 09:16, arunkumar1111 wrote:
> hi
>
> I have data like this in a dataframe
>
> Var  Value Cheque
> X1    40    FALSE
> X2    20    FALSE
> X3    28    TRUE
>
> 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.integer(Cheque)

Uwe Ligges


>
> --
> View this message in context: http://r.789695.n4.nabble.com/Replacing-a-value-in-a-dataframe-tp4122188p4122188.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.