[R] character string to name

Thomas Lumley tlumley at u.washington.edu
Mon Jul 9 16:25:07 CEST 2007


On Mon, 9 Jul 2007, Jim Lemon wrote:

> Hi folks,
>
> I thought I recalled a request for turning a character string into an
> object name as in:

Yes. It's a FAQ.

 	-thomas


> x$as.name("y")<-1:4
>
> OR
>
> x<-data.frame(as.name("y")=1:4)
>
> However, as.name and a few other uninformed attempts didn't even come
> close. A search of "character to name" produced no helpful functions.
> This isn't a very urgent request, but if anyone knows some trick to
> perform this transformation, I would like to hear about it. Thanks.
>
> Jim
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
>

Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle



More information about the R-help mailing list