Re: [R] Object name and Strings?

From: Prof Brian Ripley <>
Date: Tue 18 Jul 2006 - 19:00:59 EST

On Tue, 18 Jul 2006, Stéphane Cruveiller wrote:

> Hi all,
> Is there a simple way to convert an object name to a characters string?

Yes, as.character, as in

> x <-"foo")
> x
> as.character(x)

[1] "foo"

However, I suspect you are not using the words in their technical sense (a name is a synonym for a symbol in R), so if this is not the answer, please give us an example of what you are trying to do (which might be deparse).

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list PLEASE do read the posting guide! and provide commented, minimal, self-contained, reproducible code.

Received on Tue Jul 18 20:26:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 18 Jul 2006 - 22:16:51 EST.

Mailing list information is available at Please read the posting guide before posting to the list.