fun <- function(dataframe, var){
print(data$var)
}
dataset <- data.frame(a = 1:6, b = 12:17, c = 3:8)
fun(dataset, a)
Essentially, I would like to do something like this where I can just pass one of the column names into a function and be able to use it to call that column later on.
I know the group_by function handles it somehow, but when I went into debugging mode and tried to figure it out, I couldn't make heads or tails of what was actually doing what I wanted.