R 粘贴函数

R 粘贴函数,r,dataframe,tidyverse,paste,tibble,R,Dataframe,Tidyverse,Paste,Tibble,我尝试在TIBLE上使用粘贴功能,但我得到以下结果。我曾尝试使用as.data.frame对其进行转换,但结果是一样的。我真的需要使用dplyr来管理更大的数据集 提前谢谢 Species=iris %>% select(Species) paste("This is a ",Species) [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,

我尝试在TIBLE上使用粘贴功能,但我得到以下结果。我曾尝试使用as.data.frame对其进行转换,但结果是一样的。我真的需要使用dplyr来管理更大的数据集

提前谢谢

Species=iris %>% select(Species)
paste("This is a ",Species)
[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,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,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,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、3、3、3、3、3、3、3、3


这是一个解决方案,我必须努力。您可以使用mutate将字符串粘贴在一起,这是一个与“物种”列的组合。我已将其保存为一个名为which_species的变量

# Load tidyverse
library(tidyverse)

# Select Species from iris 
Species = iris %>% select(Species)
 
# I created a new variable pasting your string and the Species column together
Species <- Species %>% mutate(which_species = paste0("This is a ", Species))

# Check out the output
head(Species)

你到底想干什么?可能您需要的是物种=iris%>%pullSpecies,而不是selectpaste'This is a',iris$物种?