Re: [R] assign a value to an element

2012-03-19 Thread John Kane
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" >&

Re: [R] assign a value to an element

2012-03-18 Thread David Winsemius
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

Re: [R] assign a value to an element

2012-03-18 Thread William Dunlap
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, "

[R] assign a value to an element

2012-03-18 Thread Marc Girondot
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