On Dec 12, 2008, at 8:41 AM, Gabor Grothendieck wrote:
Its a FAQ:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f
On Fri, Dec 12, 2008 at 8:30 AM, Philip Whittall
wrote:
I am still struggling to map a character string to an object name and
vice ver
paste()
?paste
- Original Message -
From: "Philip Whittall"
To:
Sent: Friday, December 12, 2008 1:30 PM
Subject: Re: [R] Extracting the name of an object into a character string
and vice versa
I am still struggling to map a character string to an object name and
vic
Its a FAQ:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f
On Fri, Dec 12, 2008 at 8:30 AM, Philip Whittall
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,
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 following
behaviour ...
> attach(warpbreaks)
> levels(tension)
[1] "L" "M" "H"
> levels(as.name("tension"))
NULL
> objectname<-as.name("tension")
>
do you mean something like the following:
f <- function (x) {
deparse(substitute(x))
}
x <- 5
y <- 6
z <- 7
f(x)
f(y)
f(z)
I hope it helps.
Best,
Dimitris
Philip Whittall wrote:
Dear List,
I am writing a function in R with the facility to store models for later
use in scoring.
It wou
5 matches
Mail list logo