Re: [R] Converting a Vector into a 2-level Factor

2009-10-22 Thread Henrique Dallazuanna
Try this; factor(vowels == "aa", labels = c("aa", "~aa")) On Thu, Oct 22, 2009 at 4:36 AM, wrote: > Hello Everyone, > > Let's say I have a vector as follows: > > vowels = c("aa", "aa", "ah", "ao", "eh) > > I want to make a factor consisting of two levels: the things that are "aa" > and those th

[R] Converting a Vector into a 2-level Factor

2009-10-21 Thread ntyson
Hello Everyone, Let's say I have a vector as follows: vowels = c("aa", "aa", "ah", "ao", "eh) I want to make a factor consisting of two levels: the things that are "aa" and those that are not "aa". How would I do that? I tried using factor(vowels, levels=c("aa", "~aa"), exclude=NULL), but