Sunday, 8 September 2013

Reshape R: split a column

Reshape R: split a column

A really simple question but I could'nt find a solution: I have a
data.frame like
V1 <- c("A","A","B","B","C","C")
V2 <- c("D","D","E","E","F","F")
V3 <- c(10:15)
df <- data.frame(cbind(V1,V2,V3))
i.e.
V1 V2 V3
A D 10
A D 11
B E 12
B E 13
C F 14
C F 15
And I would like
V1 V2 V3.1 V3.2
A D 10 11
B E 12 13
C F 14 15
I try reshape{stats} and reshape2

No comments:

Post a Comment