[R] Updating an object

2009-07-21 Thread megh
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

Re: [R] Updating an object

2009-07-21 Thread Uwe Ligges
megh wrote: 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

Re: [R] Updating an object

2009-07-21 Thread Ben Bolker
Uwe Ligges-3 wrote: megh wrote: 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