New to R. I created a new variable with dplyr::mutate() and I see the values in the df output when I run the code, but when I try to plot it with ggplot, I receive object not found error. What am I doing wrong? Thx.
Works as expected:
mutate(avg_inv = (inv_total / sr_count))
Error here:
# Plot avg invoice
p <- ggplot(df1, aes(x = Date_Group, y = avg_inv) ) +
geom_bar(stat = "identity", position="dodge")
p
Error message:
Error in eval(expr, envir, enclos) : object 'avg_inv' not found
df1? As in something likedf1 = mutate(df1, avg_inv...). - aosmith