How to put all values from a column into a c()
function. For example:
Column A | Column B |
---|---|
A | 100 |
B | 200 |
C | 300 |
How do I get all values of Column A
into c('A', 'B', 'C')
, without "hard-coding" the values?
I tried using c(df$Column.A)
, but I'm not sure if this works/the best way to do this.
CodePudding user response:
We could use dput()
:
dput(df$ColumnA)
c("A", "B", "C")