[R] data.frame to shape

2006-08-09 Thread Leonardo Lami
Hi all, I have a simple question: I have a data.frame like this: id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50 1647405 4815347 5 50 1647292 4815552 6 50 1647737 4815410 7 74 1647555 4815201 8 74 1647464 4815023 9 74 1646970 4815129 10 74 1646895

[R] R: data.frame to shape

2006-08-09 Thread Guazzetti Stefano
PROTECTED] [mailto:[EMAIL PROTECTED] conto di Leonardo Lami Inviato: 09 August, 2006 15:33 A: r-help@stat.math.ethz.ch Oggetto: [R] data.frame to shape Hi all, I have a simple question: I have a data.frame like this: id x y 1 50 1647685 4815259

Re: [R] data.frame to shape

2006-08-09 Thread Gabor Grothendieck
Try this: DF[unlist(tapply(rownames(DF), DF$id, function(x) c(x, x[1]))),] On 8/9/06, Leonardo Lami [EMAIL PROTECTED] wrote: Hi all, I have a simple question: I have a data.frame like this: id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50