3
我有一個數據幀,如強迫據幀組列出
id <- c(1,1,1,2,2,3,3,3,3)
element <- c(25122,356,4454,5432,342340,12443,12354,123536,234134)
df <- data.frame(id = as.factor(id), element)
我想創建id
組的列表以及它們相應的element
S,從而爲:
dflist <- list(c(25122,356,4454), c(5432,342340), c(12443,12354,123536,234134))