[R] Updating an object

megh megh700004 at yahoo.com
Tue Jul 21 10:14:05 CEST 2009


Let say, I have an arbitrary vector :

i=1
assign(paste("dat",i,sep=""), rnorm(5))

Now I want to update that "dat1" vector by ommiting last 2 elements i.e.

dat1 = dat1[c(1:3)]

However here my problem is, as "dat1" depends on another variable "i", I
cannot use above syntax directly. I want to automate above syntax such that
I can run this for any "i". Is there any way?

Thanks


-- 
View this message in context: http://www.nabble.com/Updating-an-object-tp24583524p24583524.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list