[R] How can I ran an R command whcih is present as the content of a character object

R. Michael Weylandt michael.weylandt at gmail.com
Thu Feb 23 14:40:12 CET 2012


eval(parse(text = rcom))

Michael

On Thu, Feb 23, 2012 at 8:30 AM, Aniruddha Mukherjee
<aniruddha.mukherjee at tcs.com> wrote:
> I have an object called rcom which was created by the command rcom
> <-"mean(mat_rix$COL_1)". Also the data-frame mat_rix is well defined with
> numeric values in its column 1 and its name is "COL_1".
>
> My question is how to extract (or do something with) the content of rcom
> so that it provides the mean value which I want.
> =====-----=====-----=====
> Notice: The information contained in this e-mail
> message and/or attachments to it may contain
> confidential or privileged information. If you are
> not the intended recipient, any dissemination, use,
> review, distribution, printing or copying of the
> information contained in this e-mail message
> and/or attachments to it are strictly prohibited. If
> you have received this communication in error,
> please notify us by reply e-mail or telephone and
> immediately and permanently delete the message
> and any attachments. Thank you
>
>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list