[BioC] passing in parameters to annotation packages (e.g hgu95av2)
sdavis2 at mail.nih.gov
Mon Mar 3 18:30:03 CET 2008
On Mon, Mar 3, 2008 at 12:14 PM, Tim Smith <tim_smith_666 at yahoo.com> wrote:
> I was trying to pass in a parameter (on the fly), but am unable to figure out how to get what I want. Here is what I want:
> xx <- as.list(hgu95av2SYMBOL)
> > length(xx)
>  12625
> However, when I try to build the string on the fly and pass it as a parameter, for example:
> > var <- 'hgu95av2'
> > tempVar <- paste(var,'SYMBOL',sep='')
> > yy <- as.list(tempVar)
> > length(yy)
>  1
> > tempVar
>  "hgu95av2SYMBOL"
> I understand that in the second case, I have just created a string and the results are not surprising!. But how do I get it to do what I really want?
Close! You just missed one step (see ?get):
> var <- 'hgu95av2'
> tempVar <- paste(var,'SYMBOL',sep='')
> y <- get(tempVar)
> yy <- as.list(y)
Hope that helps.
More information about the Bioconductor