Hello, Nerak,

maybe

rbind( NA, head( results, -1))

does what you want (for all columns at once)?

Hth,
Gerrit



On Wed, 18 Jan 2012, Nerak wrote:

Dear all,
I have a question concerning manipulating data of several columns of a dataframe at the same time. I manage to do it for one column (with the use of the specific name for this column). In each columns, I have 60 values. But I should reorganize the values (because I created this as an output before and I want to compare it with an other dataset). I want that the value on row 2 becomes the value of row 1, value 3 value 2 and so on. The first value would be NA.

If I would do this for 1 column (with the name depth_1), I would do it like this:

for (t in 2:60)
{
results$depth[t]<-new$depth_1[t-1]
}

[ ... snip ... ]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to