Skip to content
Back to formatted view

Raw Message

Message-ID: <CABdHhvFBwPTpKL-Ry8Vy47ycnsJngjfF_bOi_H8nt+D4kheOQQ@mail.gmail.com>
Date: 2013-04-24T13:02:41Z
From: Hadley Wickham
Subject: as.name and namespaces
In-Reply-To: <5177A607.10706@pburns.seanet.com>

On Wed, Apr 24, 2013 at 4:29 AM, Patrick Burns <pburns at pburns.seanet.com> wrote:
> Here is an example problem:
>
>> mycall <- expression(lm(Y ~ x))[[1]]
>> mycall
> lm(Y ~ x)
>> newname <- "stats::lm"
>
>> desiredResult
> stats::lm(Y ~ x)
>
> I've solved the problem in the kludgy way of
> deparsing, fixing the string and then parsing.

I'm working on a comprehensive write up of computing on the language
at the moment. It's still a bit rough, but you might find
https://github.com/hadley/devtools/wiki/Expressions#structure-of-expressions
and https://github.com/hadley/devtools/wiki/Expressions#calls to be
useful.

Hadley

--
Chief Scientist, RStudio
http://had.co.nz/