How to convert a character string to a variable name?
3
0
Entering edit mode
@groot-philip-de-1307
Last seen 8.4 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20050901/ c6ab8d9e/attachment.pl
• 406 views
ADD COMMENT
0
Entering edit mode
@ariel-chernomoretz-885
Last seen 8.4 years ago
Hi, I am not 100% sure, but you could try get("1441536_at", envir=get(sprintf("%sLOCUSID", cleancdfname(cdfName(x), addcdf=FALSE)))) Ariel./ On September 1, 2005 09:35 am, Groot, Philip de wrote: > Hello all, > > > > I have the following particular problem. Consider the following two > R/BioC commands: > > > > 1. > get("1441536_at", envir=mouse4302LOCUSID) > > [1] 208715 > > 2. get("1441536_at", envir=sprintf("%sLOCUSID", cleancdfname(cdfName(x), > addcdf=FALSE))) > > Error in get(x, envir, mode, inherits) : invalid 'envir' argument > > > > The problem with the second command is that the 'envir' variable is > presented as a character string. R cannot handle this and I cannot > overcome this problem. Somehow, I must make it clear to R that this is > not a string, but that it is a variable name. Has anyone any idea how to > do this? This problem seems to be an obvious one, but I spent quite some > time on this without finding a solution. > > > > Regards, > > > > Philip de Groot > > Wageningen University > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- Ariel Chernomoretz, Ph.D. Centre de recherche du CHUL 2705 Blv Laurier, bloc T-367 Sainte-Foy, Qc G1V 4G2 (418)-525-4444 ext 46339
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 6 hours ago
United States
Groot, Philip de wrote: > Hello all, > > > > I have the following particular problem. Consider the following two > R/BioC commands: > > > > 1. > get("1441536_at", envir=mouse4302LOCUSID) > > [1] 208715 > > 2. get("1441536_at", envir=sprintf("%sLOCUSID", cleancdfname(cdfName(x), > addcdf=FALSE))) Here is an example from GOHyperG() in the GOstats package: getDataEnv <- function(name, lib) { get(paste(lib, name, sep = ""), mode = "environment") } Then you would use get("1441536_at", getDataEnv("LOCUSID", sub("cdf$","", cleancdfname(cdfName(x))))) Best, Jim > > Error in get(x, envir, mode, inherits) : invalid 'envir' argument > > > > The problem with the second command is that the 'envir' variable is > presented as a character string. R cannot handle this and I cannot > overcome this problem. Somehow, I must make it clear to R that this is > not a string, but that it is a variable name. Has anyone any idea how to > do this? This problem seems to be an obvious one, but I spent quite some > time on this without finding a solution. > > > > Regards, > > > > Philip de Groot > > Wageningen University > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor -- James W. MacDonald Affymetrix and cDNA Microarray Core University of Michigan Cancer Center 1500 E. Medical Center Drive 7410 CCGC Ann Arbor MI 48109 734-647-5623
ADD COMMENT
0
Entering edit mode
@groot-philip-de-1307
Last seen 8.4 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/bioconductor/attachments/20050901/ e46db44b/attachment.pl
ADD COMMENT

Login before adding your answer.

Traffic: 319 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6