ggplot(flights, aes(sched_arr_time)) +
geom_bar()
this works fine, but this does not
plot <- function(colname) {
ggplot(flights, aes(colname)) +
geom_bar()
}
plot(sched_arr_time)
I've tried inserting the column name in every way I could think of and nothing seems to work? c(colname), c('colname'), 'colname' none of them work.
also tried:
plot <- function(colname) {
p <- ggplot(node2, aes(colname))
p + geom_histogram()
}
this did not work either. If anyone needs specific error messages from every of the above mentioned attempts I can provide them. Appreciate the help.