I am trying to list elements of a dataframe (ordered by column) with row.names using dplyr
temp_df<-data.frame(c(1,3),c(2,4))
colnames(temp_df)<-c("col1","col2")
row.names(temp_df)<-c("r1","r2")
temp_df
require(dplyr)
temp_df%>%split(colnames(temp_df))
Goal
col1
r1 1
r2 3
col2
r1 2
r2 4
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…