order==TRUE ], ordered)
Debs
From: Debs Majumdar
To: Rui Barradas
Cc: Anthony Damico ; "r-help@r-project.org"
Sent: Tuesday, January 1, 2013 4:14 AM
Subject: Re: [R] Order variables automatically
Yes. That's true. All the variables are
line. Is this step necessary?
d[ , vars.to.order ] <- lapply( d[ , vars.to.order==TRUE ], ordered)
Debs
To: Rui Barradas
Cc: Anthony Damico ; "r-help@r-project.org"
Sent: Tuesday, January 1, 2013 4:14 AM
Subject: Re: [R] Order variables autom
radas
Cc: Anthony Damico ; "r-help@r-project.org"
Sent: Tuesday, January 1, 2013 4:04 AM
Subject: Re: [R] Order variables automatically
Hello,
You must have a way of telling whether the variables are
categorical. If they are factors, just not ordered factors, instead
of gre
gt;
> So, the grep command won't work here.
>
> Thanks,
>
> Debs
>
>
>
>
> From: Anthony Damico
>
> Cc: "r-help@r-project.org"
> Sent: Tuesday, January 1, 2013 12:24 AM
> Subject: Re: [R] Order variables
nks,
Debs
From: Anthony Damico
Cc: "r-help@r-project.org"
Sent: Tuesday, January 1, 2013 12:24 AM
Subject: Re: [R] Order variables automatically
# create an example data frame
yourdata <-
data.frame(
cat1 = c( 1 , 0 , 1 ) ,
# create an example data frame
yourdata <-
data.frame(
cat1 = c( 1 , 0 , 1 ) ,
cont1 = c( 0 , 1 , 0 ) ,
cat2 = c( 0 , 0 , 1 )
)
# if this doesn't work for you,
# please ?dput some example data in the future :)
# figure out which variables contain the word 'cat'
vars
Hi,
I have a dataset with 6 categorical variables. I have used this following code
to make the variables u1-u6 ordered factors and this works well.
cat1cat2 cat3 cat4 cat5 cat6
0 1 1 0 0 1
1 1 0 0 0 0
...
data<-read,table(
7 matches
Mail list logo