Re: [R] Order variables automatically

2013-01-01 Thread Rui Barradas
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

Re: [R] Order variables automatically

2013-01-01 Thread Debs Majumdar
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

Re: [R] Order variables automatically

2013-01-01 Thread Debs Majumdar
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

Re: [R] Order variables automatically

2013-01-01 Thread Rui Barradas
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

Re: [R] Order variables automatically

2013-01-01 Thread Debs Majumdar
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 ) ,      

Re: [R] Order variables automatically

2013-01-01 Thread Anthony Damico
# 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

[R] Order variables automatically

2012-12-31 Thread Debs Majumdar
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(