Displaying 1 result from an estimated 1 matches for "fac_a".
Did you mean:
fact_a
2008 Dec 01
1
Help with lattice graphics
...ta frame with 4 columns
# factors in first 3 cols and a numeric in the 4th
vec_a<-paste("A",1:4,sep=(''));na<-length(vec_a)
vec_b<-paste("B",1:5,sep=(''));nb<-length(vec_b)
yr<-c("2007","2008","2009");ny<-length(yr)
fac_a<-factor(vec_a);fac_b<-factor(vec_b);fac_yr<-factor(yr)
n<-na*nb*ny
# y is the response variable
y<-runif(n);y<-round(y,digits=1)
dfa<-rep(fac_a,times=nb*ny)
dfb<-rep(fac_b,each=na,times=ny)
dfyr<-rep(fac_yr,each=na*nb)
dataf<-data.frame(dfa=dfa,dfb=dfb,dfyr=dfyr,y=y);h...