Re: How "eval" results returned by "paste0" ?
Michael Lawrence <lawrence.michael-RuTDbSqP/[email protected]>
| Newsgroups | gmane.science.biology.informatics.conductor |
|---|---|
| Message-ID | <CAOQ5Nye-E3TVwMjcOUa6azcLA2aSpwk=AtpgtdWzS4U_pApvUA@mail.gmail.com> |
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-9Onoh4P/[email protected]> 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
> [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