[BioC] How "eval" results returned by "paste0" ?
Michael Lawrence
lawrence.michael at gene.com
Wed Aug 20 14:49:02 CEST 2014
The result of paste0 is a character vector, so it's already evaluated and
eval() will act like identity(). If you want to convert your character
vector to a language object, use parse(text=v), so:
> eval(parse(text=paste0('1','+','1')))
[1] 2
On Wed, Aug 20, 2014 at 5:40 AM, my1stbox <my1stbox at 163.com> wrote:
> Hi All,
> It seem that I can never get the returned values of 'paste0' been
> evaluated , as well as any characters that have been quoted. Do I have to
> use 'substr' or 'gsub' to remove these quotation marks ?
> Bests,
> Allen Chiu
>
> > eval(paste0('1','+','1'))
> [1] "1+1"
> > eval(expression(paste0('1','+','1')))
> [1] "1+1"
> > eval(expression("1+1"))
> [1] "1+1"
> > eval("1+1")
> [1] "1+1"
> > eval(expression(1+1))
> [1] 2
> > eval(1+1)
> [1] 2
>
>
>
>
>
>
> 2014-08-20
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
[[alternative HTML version deleted]]
More information about the Bioconductor
mailing list