7
提取dplyr tbl列作为向量
是否有更简洁的方法从带有数据库后端的tbl中获取dplyr tbl的一列作为向量(即,数据帧/表不能直接成为子集)? require(dplyr) db <- src_sqlite(tempfile(), create = TRUE) iris2 <- copy_to(db, iris) iris2$Species # NULL 那太容易了,所以 collect(select(iris2, Species))[, 1] # [1] "setosa" "setosa" "setosa" "setosa" etc. 但是似乎有点笨拙。
175
r
dplyr
lazy-evaluation
collect