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