e-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
>> project.org] On Behalf Of Ralf B
>> Sent: Wednesday, October 06, 2010 10:32 AM
>> To: r-help Mailing List
>> Subject: [R] Create variable by name
>>
>> Can one create a variable thro
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Ralf B
> Sent: Wednesday, October 06, 2010 10:32 AM
> To: r-help Mailing List
> Subject: [R] Create variable by name
>
> Can one create a variable th
On Oct 6, 2010, at 12:58 PM, David Winsemius wrote:
On Oct 6, 2010, at 12:32 PM, Ralf B wrote:
Can one create a variable through a function by name
Isn't that what "<-" does?
createVariable <- function(name) {
outputVariable = name
name <- NULL
}
after calling
createVa
On Oct 6, 2010, at 12:32 PM, Ralf B wrote:
Can one create a variable through a function by name
Isn't that what "<-" does?
createVariable <- function(name) {
outputVariable = name
name <- NULL
}
after calling
createVariable("myVar")
?assign # and isn't this covered in
An alternative to Peter's solution:
createVariable <- function(name) {assign(name, NULL, envir=.GlobalEnv)}
Jeff.
On Wed, Oct 6, 2010 at 12:32 PM, Ralf B wrote:
> Can one create a variable through a function by name
>
> createVariable <- function(name) {
> outputVariable = name
>
On Wed, Oct 6, 2010 at 9:32 AM, Ralf B wrote:
> Can one create a variable through a function by name
>
> createVariable <- function(name) {
> outputVariable = name
> name <- NULL
> }
>
> after calling
>
> createVariable("myVar")
>
> I would like to have a variable myVar initialized w
On Wed, Oct 6, 2010 at 9:32 AM, Ralf B wrote:
> Can one create a variable through a function by name
>
> createVariable <- function(name) {
> outputVariable = name
> name <- NULL
> }
>
> after calling
>
> createVariable("myVar")
>
> I would like to have a variable myVar initialized w
Can one create a variable through a function by name
createVariable <- function(name) {
outputVariable = name
name <- NULL
}
after calling
createVariable("myVar")
I would like to have a variable myVar initialized with NULL in my
environment. Is this possible?
Ralf
8 matches
Mail list logo