Re: [R] use list elements to subtract values from the dataframe

From: Julian Burgos <jmburgos_at_u.washington.edu>
Date: Wed, 07 May 2008 10:37:44 -0700

Try
get(paste("wf$",fl[[1]],sep=""))

See ?get

Julian

Dirkheld wrote:
> Hi,
>
> I have a dataframe wf existing of a header with different labels and beneath
> the values of those labels :
> wf:
> label1 label2 ...
> 0,45 0,21
> 0,10 0,45
> .... ....
>
> I have a list
> fl <- c("label2","label3",..)
>
> Isn't possible to use the list elements in the list in order to subtract
> values from the dataframe? like :
> wf$fl[[1]]
> When I do in R I get :NULL
> fl[[1]] gives "label2" so no problem here...
>
> While wf$label1 works fine.
>
>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 07 May 2008 - 17:41:46 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 07 May 2008 - 18:30:35 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive