; -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Conradsb
> Sent: Wednesday, September 05, 2012 2:14 PM
> To: r-help@r-project.org
> Subject: [R] Recoding categorical gender variable into numeric factors
>
Hi Conrad,
On Wed, Sep 5, 2012 at 3:14 PM, Conradsb wrote:
> I currently have a data set in which gender is inputed as "Male" and "Female"
> , and I'm trying to convert this into "1" and "0".
This is usually not necessary, and makes things more confusing. "Male"
and "Female" is clear and self-ex
I currently have a data set in which gender is inputed as "Male" and "Female"
, and I'm trying to convert this into "1" and "0".
I found a website which reccomended using two commands:
data$scode[data$sex=="M"] <- "1"
data$scode[data$sex=="F"] <- "2"
to convert to numbers, and:
data$scode <- fa
3 matches
Mail list logo