Dear Rajat, Just change this data82$contact <- factor(contact,labels=c("low","high"))
for this data82$contact <- factor(data82$contact,labels=c("low","high")) HTH, Jorge On Mon, Apr 13, 2009 at 12:24 PM, Rajat <razz...@gmail.com> wrote: > I am solving the following question. I want to label the data. I used the > following code. > > > data82 <- read.table(file="/home/rajat/R/8_2_rtg.txt",header=T) > > > data82 <- data.frame(data82) > > > data82 > low_sat med_sat high_sat contact housing > 1 65 54 100 1 1 > 2 130 76 111 1 2 > 3 67 48 62 1 3 > 4 34 47 100 2 1 > 5 141 116 191 2 2 > 6 130 105 104 2 3 > > > sapply(data82,class) > low_sat med_sat high_sat contact housing > "integer" "integer" "integer" "integer" "integer" > > > > data82$contact<-factor(contact,labels=c("low","high")) > > When I run the last line I get the following message -- > > ERROR: object "contact" not found > > > Any suggestions > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.