Re: [R] Generate the next column from previous column

2011-06-23 Thread Steven Wolf
...@r-project.org] On Behalf Of Mkkl Sent: Thursday, June 23, 2011 5:17 PM To: r-help@r-project.org Subject: [R] Generate the next column from previous column Hi, I'm quite new to R and are stuck with the following problem. Lets say I have a column consisting of a 1 and the rest zero's, called G0

[R] Generate the next column from previous column

2011-06-23 Thread Mkkl
Hi, I'm quite new to R and are stuck with the following problem. Lets say I have a column consisting of a 1 and the rest zero's, called G0. G0 <- c(1,rep(0,5)) Now what I would like to do is to generate G1 from G0, and G2 from G1 etc... Just for the simplicity, let's say I need the first entry of