【发布时间】:2019-06-08 13:22:20
【问题描述】:
从我的data.frame D 中对变量t(NULLs 的向量)进行子集化后,我得到了一个类因子对象。
我使用droplevels 删除级别并得到NULLs 的向量,我想知道为什么我仍然无法获得NULLs 的向量?
D <- read.csv("https://raw.githubusercontent.com/izeh/i/master/m.csv", h = T)
L <- split(D, D$study.name) ; L[[1]] <- NULL
t <- lapply(1:length(L), function(i) L[[i]]$t)
droplevels(t[[1]]) ## keep the vector of `NULL`s but drop the levels
## EXPECTED OUTPUT:
[[1]]
[1] NULL NULL NULL NULL NULL NULL
【问题讨论】:
-
请添加预期输出