Re: How can I create a variable with name indicated by argument during function run?
Michael Lawrence <michafla-RuTDbSqP/[email protected]>
| Newsgroups | gmane.science.biology.informatics.conductor |
|---|---|
| Message-ID | <CAOQ5Nyc_FgCMECR68wH6tWmmKv7dHsp7QE9t0nCtzrxfuAgF_Q@mail.gmail.com> |
.GlobalEnv[[path_name]] <- de_gene_list I hope you have a good reason for this side effect. Also, general R questions like these are better suited for e.g. stackoverflow or R-help. On Wed, Aug 20, 2014 at 6:08 AM, my1stbox <[email protected]> wrote: > Hi All, > How can I create a variable with a name identical to the character value > of an argument that I passed to the function ? The following lines doesn’t > work. Do I have to text an expression with a combination of paste0(), > parse() first, and eventually evaluate it with eval()? > > f <- > function(Argument.to.carry.the.value.that.I.want.to.use.as.name.of.variable.to.be.created){ > > as.name > (Argument.to.carry.the.value.that.I.want.to.use.as.name.of.variable.to.be.created)=my.gene.list > > } > f(the.name) > > Bests, > Allen Chiu > > PS: What I really want to do is to create a global variable during the > function run, like: > > de.limma=function(path_name){ > …………… > .GlobalEnv$”as indicated by the path_name argument”=de_gene_list > } > > > > 2014-08-20 > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > [email protected] > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor [[alternative HTML version deleted]] _______________________________________________ Bioconductor mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/bioconductor Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor