我试图得到一个布尔响应,即包含列表的向量的每一行是否为空。
根据这里的各种问题,我尝试了以下方法
g <- combined_plan %>%
mutate(d = is.null(bck),
e = length(bck),
f = nchar(bck),
h = is.list(bck)
)
Is.null
<NULL>
在tibble中,
length
27561
,
is.list
始终正确。这似乎使用了公认的选项
here
nchar
我如何才能清楚地发现tibble中的相关位置是否存在列表?
structure(list(fwd = list(structure(c("44993002", "44993003",
"44993004", "44993005", "44993006", "44993007", "44993008", "44993009",
"4499301", "4499302", "4499303", "4499304", "4499305", "4499306",
"4499307", "4499308", "4499309"), .Dim = c(17L, 1L)), structure(c("78110023",
"78110024", "78110025", "78110026", "78110027", "78110028", "78110029",
"7811003", "7811004", "7811005", "7811006", "7811007"), .Dim = c(12L,
1L)), structure(c("27610013", "27610014", "27610015", "27610016",
"27610017", "27610018", "27610019", "2761002", "2761003", "2761004",
"2761005", "2761006"), .Dim = c(12L, 1L)), structure(c("44223002",
"44223003", "44223004", "44223005", "44223006", "44223007", "44223008",
"44223009", "4422301", "4422302", "4422303", "4422304", "4422305",
"4422306", "4422307", "4422308", "4422309"), .Dim = c(17L, 1L
)), structure(c("27210034", "27210035", "27210036", "27210037",
"27210038", "27210039", "2721004", "2721005", "2721006", "2721007",
"2721008", "2721009"), .Dim = c(12L, 1L))), bck = list(NULL,
NULL, NULL, NULL, NULL)), .Names = c("fwd", "bck"), row.names = c(NA,
-5L), class = c("tbl_df", "tbl", "data.frame"))