Given a dataframe, I want to get column indexes (1,4,55,33..) of columns of type integer.
Given df:
col1 col2
<character> <integer>
a 1
a 2
vb 3
I want to get col1 as character column.
I am trying to do this using:
which(sapply(df, function(x) class(x) == "character") == TRUE)
Please advise.