I am teaching myself R for use in Psych research. I don't understand the error message I am getting or how to fix it. Any suggestions will be greatly appreciated


df1=read.table("fastfood.txt", header=TRUE); df1
>
> c(t(as.matrix(df1)))
>
> r = c(t(as.matrix(df1))) # response data
>
> r
>
f=c("item1","item2", "item3")
> k=3
> n=6
> tm =gl(k,1, n*k, factor(f))
> tm
[1] item1 item2 item3 item1 item2 item3 item1 item2 item3 item1 item2 item3
[13] item1 item2 item3 item1 item2 item3
Levels: item1 item2 item3

> av=aov(r~tm)
>
> Error in model.frame.default(formula = r ~ tm, drop.unused.levels = TRUE) :
>    variable lengths differ (found for 'tm')


Thanks in advance

Harold Rodinsky PhD
Associate Professor
Department of Psychology
University of the Incarnate Word
4301 Broadway
San Antonio, TX 78209



________________________________
This email and any files transmitted with it may be conf...{{dropped:13}}

