Hi R User,
I was trying to create a data matrix with four columns: height, locations
(three locations), temperature (three levels) and slope (three classes) and
used the following code, but it did not work.  I basically wanted to have
20 rows for each class (I have a total of 9 classes). Can you help me to
fix the following code so that I can create the data frame?

daT<-data.frame(height=c(5:15))

minHeight=min(daT$height)

maxHeight=max(daT$height)

height.value= minHeight +(0:20)*(maxHeight-minHeight)/20


daT<-data.frame(height=height.value, location=rep(c("SiteA", "SiteB",
"SiteC"), 20), temperature=rep(c(10,20,30)), slope=rep(c("5deg", "10deg",
"15deg")))


Thanks

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to