[BioC] passing in parameters to annotation packages (e.g hgu95av2)

Sean Davis 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:
> Hi,
>
>  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)
>  [1] 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] 1
>  > tempVar
>  [1] "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):

> library(hgu95av2)
> var <- 'hgu95av2'
> tempVar <- paste(var,'SYMBOL',sep='')
> y <- get(tempVar)
> yy <- as.list(y)
> length(yy)
[1] 12625

Hope that helps.

Sean



More information about the Bioconductor mailing list