ahoo.fr
> Sent: Sun, 18 Mar 2012 18:24:34 + (GMT)
> To: r-help@r-project.org
> Subject: [R] assign a value to an element
>
> Assign can be used to set a value to a variable that has name as a value
> of another variable. Example:
>
>> name<-"essai"
>&
On Mar 18, 2012, at 2:24 PM, Marc Girondot wrote:
Assign can be used to set a value to a variable that has name as a
value of another variable. Example:
name<-"essai"
assign(name, "plouf")
essai
[1] "plouf"
OK.
But how to do the same when it is only an element of a vector, data
frame an
h 18, 2012 11:25 AM
> To: r-help@r-project.org
> Subject: [R] assign a value to an element
>
> Assign can be used to set a value to a variable that has name as a value of
> another
> variable. Example:
>
> > name<-"essai"
> > assign(name, "
Assign can be used to set a value to a variable that has name as a value of
another variable. Example:
> name<-"essai"
> assign(name, "plouf")
> essai
[1] "plouf"
OK.
But how to do the same when it is only an element of a vector, data frame and
so on that must be changed.
> vec<-1:10
> vec
[1
4 matches
Mail list logo