I have a function that takes as input a specific column name. I then want to grab the column of a data frame that corresponds to that name. The problem is if I have code like this:
New <- function(name) {
dataframe$name
}
then it looks for the column with the name "name" and not the name I input in the function. Is there any way to get around this?
New <- function(name) { dataframe[, name] }