[R] eval and as.symbol question

Kaspar Pflugshaupt pflugshaupt at geobot.umnw.ethz.ch
Thu Oct 18 14:19:48 CEST 2001


On 18.10.2001 13:46 Uhr, Gary Collins wrote:

> But when I merge these into a dataframe with colnames(df)<-
> c("c1","c2","c3","c4","c5"), so that
>> df
> c1 c2 c3 c4 c5
> 1  1  1 NA NA NA
> 2  2  2 NA NA NA
> 3  3  3 NA NA NA
> 4 NA NA NA  1  1
> 5  2  2  2  2  2
> 6  2  2  2  2  2
> 7 NA  3  3 NA  2
> 
> and try the next "logical" step from above....
> 

You might try something like this instead:

apply(df, 2, function(x) sum(is.na(x)))



Hope this helps

Kaspar


-- 

Kaspar Pflugshaupt
Geobotanisches Institut
Zuerichbergstr. 38
CH-8044 Zuerich

Tel. ++41 1 632 43 19
Fax  ++41 1 632 12 15

mailto:pflugshaupt at geobot.umnw.ethz.ch
privat:pflugshaupt at mails.ch
http://www.geobot.umnw.ethz.ch

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list