[R] Code Help

Ko-Kang Kevin Wang kwan022 at stat.auckland.ac.nz
Wed May 21 03:29:06 CEST 2003


Hi,

On Wed, 21 May 2003, Stephen Beale wrote:

> Code:
> 
> options(digits=3)
> 
> clover <- read.table("Lines.txt",header=T,sep=",")
> vnames <- names(clover);nv <- length(vnames)
> flevels <- levels(clover$Line)
> 
> par(oma=c(0,6,4,6),mfrow=c(2,1),mar=c(4,4,1,0))
> 
> clover$Y <- clover[,"LeafLmm"]
> mn.tab <- tapply(clover$Y,list(clover$Line),mean)
> sd.tab <- sqrt(tapply(clover$Y,list(clover$Line),var))
> 
> om <- order(mn.tab)
> plot(mn.tab,sd.tab,las=1,xlab="mean",ylab="s.d.")
> lines(lowess(mn.tab,sd.tab))
> 
> 
> model.i <- glm(Y  ~ C(clover$Line,Cline),data=clover,family=gaussian),

Take a close look at this line.  For one thing you have got a comma at the 
end which produce a syntax error.

Secondly, what is Cline?  I did a:
> colnames(clover)
[1] "Line"          "repl"          "LeafLmm"       "LeafWmm"      
[5] "Stolonthickmm" "StolonLcm"     "StolonDens"    "LeafAmm"      
[9] "Y"  

and it showed no column with name Cline.


-- 
Cheers,

Kevin

------------------------------------------------------------------------------
/* Time is the greatest teacher, unfortunately it kills its students */

--
Ko-Kang Kevin Wang
Master of Science (MSc) Student
SLC Tutor and Lab Demonstrator
Department of Statistics
University of Auckland
New Zealand
Homepage: http://www.stat.auckland.ac.nz/~kwan022
Ph: 373-7599
    x88475 (City)
    x88480 (Tamaki)




More information about the R-help mailing list