Re: [R] dataframe row names from list

2010-09-06 Thread Jim Lemon
On 09/06/2010 09:41 PM, raje...@cse.iitm.ac.in wrote: Hi, I have a list which looks like this... str(y) List of 10 $ : chr [1:4] "ABCD" "5" "0" "1" $ : chr [1:4] "DEF" "15" "1" "16" $ : chr [1:4] "AAA" "2" "17" "8" $ : chr [1:4] "SSS" "15" "25" "1" $ : chr [1:4] "III" "15" "26" "4"

Re: [R] dataframe row names from list

2010-09-06 Thread Ivan Calandra
Hi! I'm sure there's an easier way, but that works for me: test_list <- list(c("ABC","5","0"), c("DEF","10","1")) ##just a part of your example, think about using dput() to create a copy/pastable example test_df <- t(as.data.frame(test_list)[-1,]) rownames(test_df) <- t(as.data.frame(test_list

[R] dataframe row names from list

2010-09-06 Thread raje...@cse.iitm.ac.in
Hi, I have a list which looks like this... > str(y) List of 10 $ : chr [1:4] "ABCD" "5" "0" "1" $ : chr [1:4] "DEF" "15" "1" "16" $ : chr [1:4] "AAA" "2" "17" "8" $ : chr [1:4] "SSS" "15" "25" "1" $ : chr [1:4] "III" "15" "26" "4" $ : chr [1:4] "OPQ" "7" "30" "4" $ : chr [1:4] "TYR" "14" "3