[R] Create and Assign value into a variable from Another variable

Greg Snow 538280 at gmail.com
Tue Aug 28 18:25:44 CEST 2012


Others have mentioned assign and get, but generally when the answer to
a question is "assign" it means that you are asking the wrong question
(see fortune(236)).

This is actually FAQ 7.21, the most useful part of the answer in the
FAQ is the last few lines.

If you tell us more about what you are actually trying to accomplish
then we have a better chance of giving you useful advice that is less
likely to lead to future frustration.


On Tue, Aug 28, 2012 at 12:48 AM, Rantony <antony.akkara at ge.com> wrote:
> Hi,
>
> Here i have a variable named "MyVariable" containing particular name
>
> For eg:-
> MyVariable <- "UnitNo"
>
> Here my requirement is, i need to get "UnitNo" as another variable by
> reading "MyVariable"
>
> i need  "UnitNo" as variable name and need to assign some value into that.
>
> i had tried with as.name(MyVariable ) and as.character(MyVariable) - Its
> getting that value, but im unable to assign
> something into that variable.
>
> Could you please help me ?
>
> - Thank you
> Antony
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Create-and-Assign-value-into-a-variable-from-Another-variable-tp4641515.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com




More information about the R-help mailing list