get_column <- function(df, feature) {
return(df$feature)
}
get_column(mtcars, "mpg")
## NULL
When I put a dataframe into an argument of the above function and try to return a column from it. I get NULL as the result. Why is this the case and how can I properly perform this task?