[R] Extracting the name of an object into a character string and vice versa
dwinsemius at comcast.net
Sat Dec 13 23:50:17 CET 2008
On Dec 12, 2008, at 8:41 AM, Gabor Grothendieck wrote:
> Its a FAQ:
> On Fri, Dec 12, 2008 at 8:30 AM, Philip Whittall
> <Philip.whittall at detica.com> wrote:
>> I am still struggling to map a character string to an object name and
>> vice versa in R.
>> I thought the as.name() function might work, but observe the
>> behaviour ...
>>  "L" "M" "H"
>> So even though it sets up a symbol, this symbol isn't recognised as
>> object name by functions such as levels().
>> I need 2 functions, call them A and B such that A("tension") yields
>> object name tension which is recognised by functions and
>> B(tension) yields the character result "tension".
I see that your first request was satisfied. Your second one, that for
a method to get as a character object the name of an object did not
seem to get addressed. If tension is an R object (or a function call),
> tension <- vector()
--- a function with no arguments
--- a function ( in this case the Extract or indexing function) with
 "$" "fit" "terms"
>> Any suggestions would be greatly appreciated,
>> This message should be regarded as confidential. If you have
>> received this email in error please notify the sender and destroy
>> it immediately.
>> Statements of intent shall only become binding when confirmed in
>> hard copy by an authorised signatory. The contents of this email
>> may relate to dealings with other companies within the Detica Group
>> plc group of companies.
>> Detica Limited is registered in England under No: 1337451.
>> Registered offices: Surrey Research Park, Guildford, Surrey, GU2
>> 7YP, England.
>> [[alternative HTML version deleted]]
>> R-help at r-project.org mailing list
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
> R-help at r-project.org mailing list
> 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