Re: [R] How can I rearange my dataframe

2010-02-09 Thread David Winsemius
On Feb 9, 2010, at 11:24 AM, Alex Levitchi wrote: Hello I am recently began to work with R, so I am not so experienced. But anyway I cannot find a clear way to process my dataframe which is a bigger one. It shows similar to this name=c("A","B","C","B","C","C","C","B","C") nicknames=c("A1",

Re: [R] How can I rearange my dataframe

2010-02-09 Thread jim holtman
try this: > x <- read.table(textConnection("name nicknames value + 1 A A1 4 + 2 B B1 5 + 3 C C1 9 + 4 B B2 2 + 5 C C2 7 + 6 C C3 6 + 7 C C4 3 + 8 B B3 6 + 9 C C5 7"), header=TRUE) > closeAllConnections() > result <- do.call(rbind, lapply(split(x, x$name), function(.name){ + data.frame(name=.na

[R] How can I rearange my dataframe

2010-02-09 Thread Alex Levitchi
Hello I am recently began to work with R, so I am not so experienced. But anyway I cannot find a clear way to process my dataframe which is a bigger one. It shows similar to this > name=c("A","B","C","B","C","C","C","B","C") > nicknames=c("A1","B1","C1","B2","C2","C3","C4","B3","C5") > valu