business-science / free_r_tips

Free R-Tips is a FREE Newsletter provided by Business Science. It comes with bite-sized code tutorials every week.
1.23k stars 644 forks source link

028_esquisse_ggplot/shiny_app.R #4

Closed priyankagagneja closed 3 years ago

priyankagagneja commented 3 years ago

mpg dataset does not exist. You probably intended to do data("mtcars"). Similarly down below in the ui & server section.

mdancho84 commented 3 years ago

The mpg data set comes with ggplot2.

priyankagagneja commented 3 years ago

ok gotcha, looks like the code needs the call to ggplot2 then(library(ggplot1)). either one works fine.

mdancho84 commented 3 years ago

The code should work as-is. Tidyverse loads ggplot2, which contains the mpg dataset. image