0

I get this dataframe :

head(data)
  Cal    Cre
1 ca     h1  
2 cb     h2 
3 ca     h3  

I try to get a vector like this:

foo=c("ca"="h1","cb"="h2","ca"="h3")
Julie Hardy
  • 127
  • 8
  • Does this answer your question? [Convert data.frame column to a vector?](https://stackoverflow.com/questions/7070173/convert-data-frame-column-to-a-vector) – user438383 Oct 04 '20 at 17:30

1 Answers1

0
library(dplyr)
data %>%
    pull(Cre, name = Cal)
iago
  • 2,990
  • 4
  • 21
  • 27