R:行长度不相等(空值)的数据帧进入行列表
我们可以进行R:行长度不相等(空值)的数据帧进入行列表,r,list,dataframe,R,List,Dataframe,我们可以进行拆分 > l $id1 [1] "a" "b" $id2 [1] "c" > l $id1 [1] "a" "b" $id2 [1] "c" lapply(split(as.matrix(df), row.names(df)), setdiff, "") #$id1 #[1] "a" "b" #$id2 #[1] "c"
拆分
> l
$id1
[1] "a" "b"
$id2
[1] "c"
> l
$id1
[1] "a" "b"
$id2
[1] "c"
lapply(split(as.matrix(df), row.names(df)), setdiff, "")
#$id1
#[1] "a" "b"
#$id2
#[1] "c"