Re: [R] Factoring a variable

2010-06-17 Thread Steve Lianoglou
Hi, On Thu, Jun 17, 2010 at 3:45 PM, Noah Silverman wrote: > Hi, > > I have a dataset where the results are coded ("yes", "no")  We want to > do some machine learning with SVM to predict the "yes" outcome > > My problem is that if I just use the as.factor function to convert, then > it reverses t

[R] Factoring a variable

2010-06-17 Thread Noah Silverman
Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no", "no", "no", "yes", "yes",

Re: [R] Factoring a variable

2010-06-17 Thread Henrique Dallazuanna
Use factor indeed as.factor: factor(x, levels = c('yes', 'no')) On Thu, Jun 17, 2010 at 4:47 PM, Noah Silverman wrote: > Hi, > > I have a dataset where the results are coded ("yes", "no") We want to > do some machine learning with SVM to predict the "yes" outcome > > My problem is that if I jus

Re: [R] Factoring a variable

2010-06-17 Thread Erik Iverson
Noah Silverman wrote: Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no",

[R] Factoring a variable

2010-06-17 Thread Noah Silverman
Hi, I have a dataset where the results are coded ("yes", "no") We want to do some machine learning with SVM to predict the "yes" outcome My problem is that if I just use the as.factor function to convert, then it reverses the levels. -- x <- c("no", "no", "no", "yes", "yes",