..@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Joseph Lee
> Sent: Friday, February 26, 2010 10:14 PM
> To: r-help@r-project.org
> Subject: [R] somebody help me about this error message...
>
>
> I created variables automatically like this way
>
> for(i
paste("a",2,sep="") is simply creating a new character "a2"
Why not just
a2 <- 4
?
--- On Sat, 2/27/10, Joseph Lee wrote:
> From: Joseph Lee
> Subject: [R] somebody help me about this error message...
> To: r-help@r-project.org
> Received:
You forgot the assign the second time:
assign(paste("a",2,sep=""), 4)
does what you want.
Hope this helps a little
Allan.
On 27/02/10 05:13, Joseph Lee wrote:
I created variables automatically like this way
for(i in 1:5){
nam<- paste("a",i,sep="")
assign(nam,1:i)
}
and then
I created variables automatically like this way
for(i in 1:5){
nam <- paste("a",i,sep="")
assign(nam,1:i)
}
and then, i want to insert a new data into "a2" variable. so, i did next
sentence
paste("a",2,sep="") <- 4
so, i got this error message
Error in get(paste("a", 2, sep =
4 matches
Mail list logo