I have a sample dataframe below df.
df
ColA ColB ColC
A B 2
D B 3
D A 4
To get values in ColA, we can use df$ColA. But can we not reference here. For example
sa <- names(Filter(is.factor,df))
sa
sa
[1] "ColA" "ColB"
If I use the below code, I am not getting elements of ColA. Should be getting right? Or is there way to do this
df$sa[1]