Fw: [R] eval and as.symbol question

Gary Collins gco at eortc.be
Thu Oct 18 14:32:39 CEST 2001


----- Original Message -----
From: "Kaspar Pflugshaupt" <pflugshaupt at geobot.umnw.ethz.ch>
To: "Gary Collins" <gco at eortc.be>
Cc: "r-help" <r-help at stat.math.ethz.ch>
Sent: Thursday, October 18, 2001 2:19 PM
Subject: Re: [R] eval and as.symbol question


> 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

I want to avoid this. I know how the apply function works. The counting
missing items was merely an example, there are a number of ways to solve
that particular problem. My question is how to use as.symbol, eval and paste
to get the required result as I will use very similar steps.

Thanks
Gary
__________________________________________________
Dr. Gary S. Collins,
Statistics Research Fellow,
Quality of Life Unit,
European Organisation for Research and Treatment of Cancer,
EORTC Data Center,
Avenue E. Mounier 83, bte. 11,
B-1200 Brussels, Belgium.

Tel: +32 2 774 1 606
Fax: +32 2 779 4 568
http://www.eortc.be/home/qol/
__________________________________________________


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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