Re: [R] a string to enviroment or function

From: Weiwei Shi <helprhelp_at_gmail.com>
Date: Mon, 25 Jun 2007 16:19:20 -0400

then how to do this

f1 <- function(mylab){
  library(mylab)
  ...
}

it seems that if you call
library("hgu133a") # which is file
# but
library(mylab) # even you pass "hgu133a" as parameter, it still complains about "mylab" does not exist. It seems that it consider mylab as package instead of its value.

On 6/25/07, jim holtman <jholtman_at_gmail.com> wrote:
> I think that you might want:
>
> t0 <- (paste("hgu133a", "ENTREZID", sep=""))
> xx <- as.list(get(t0)) # make it work like xx<-as.list(hgu133aENTREZID)
>
>
>
>
> On 6/25/07, Weiwei Shi <helprhelp_at_gmail.com> wrote:
> >
> > Hi,
> >
> > I am wondering how to make a function Fun to make the following work:
> >
> > t0 <- (paste("hgu133a", "ENTREZID", sep=""))
> > xx <- as.list(Fun(t0)) # make it work like xx<-as.list(hgu133aENTREZID)
> >
> > thanks,
> > --
> > Weiwei Shi, Ph.D
> > Research Scientist
> > GeneGO, Inc.
> >
> > "Did you always know?"
> > "No, I did not. But I believed..."
> > ---Matrix III
> >
> > ______________________________________________
> > R-help_at_stat.math.ethz.ch 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.
> >
>
>
>
> --
> Jim Holtman
> Cincinnati, OH
> +1 513 646 9390
>
> What is the problem you are trying to solve?

-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III

______________________________________________
R-help_at_stat.math.ethz.ch 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 Mon 25 Jun 2007 - 20:36:50 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 Mon 25 Jun 2007 - 22:32:33 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.