【发布时间】:2020-11-18 23:30:50
【问题描述】:
我尝试在小标题上使用粘贴功能,但我在下面得到了这个结果。我试图用 as.data.frame 对其进行转换,但结果是一样的。我真的需要使用 dplyr 来管理更大的数据集。
提前致谢。
Species=iris %>% select(Species)
paste("This is a ",Species)
[1] "这是一个 c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 , 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 , 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 , 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 , 3, 3, 3, 3, 3)"
【问题讨论】:
-
你到底想做什么?可能你需要
Species=iris %>% pull(Species)而不是select -
paste('This is a', iris$Species)?
标签: r dataframe tidyverse paste tibble