Question: how to extract a column of dataframe and keep its structure as unchanged?
data <- iris data[, 1] ##this will be a vector and will lose the name
data[, 1, drop = FALSE] will do the trick.
data[, 1, drop = FALSE]