I want dplyr to return a character vector instead of a data frame. Is there an easy way to do this?
df <- data.frame( x=c('a','b','c','d','e','f','g','h'),
y=c('a','a','b','b','c','c','d','d'),
z=c('a','a','a','a','a','a','d','d'),
stringsAsFactors = FALSE)
unique(df$z)
[1] "a" "d"
df %>%
select(z) %>%
unique()
z
1 a
7 d
source
share