[R] mean on a table

Farrel Buchinsky fjbuch at gmail.com
Fri Jan 12 02:12:26 CET 2007


Please suggest areas that I should troubleshoot. This command used to
give me an answer and now it gives me an error.
> mean(no.genot,na.rm=T)
Error in tapply(x, by, sum, na.rm = TRUE) :
        arguments must have same length
I tried removing the na.rm=T)
> mean(no.genot)
Error in `names<-.default`(`*tmp*`, value = c("by.1", "by.0")) :
        attempt to set an attribute on NULL

The structure of my table is as follows.
> str(no.genot)
 table [, 1:467] 0.000 0.261 0.315 0.274 0.349 ...
 - attr(*, "dimnames")=List of 1
  ..$ : chr [1:467] "NC" "RP138" "RP139" "RP140" ...

Strangely enough
> mean(no.genot[1:467])
[1] 0.2426167

That seems to work.

-- 
Farrel Buchinsky
Mobile: (412) 779-1073



More information about the R-help mailing list