I am using a Mac to plot age vs. survival data. The plot creates but now I cannot knit into an html file due to a "Removed 177 rows containing non-finite values (stat_bin)" error. I tried changing to geom_bar and also changed scale_x_discrete but the error below shows:
Error in ggplot(data = titanic, aes(x = Age)) :
could not find function "ggplot" Calls: . . . handle -> withCallingHandlers -> withVisibl -> eval -> eval Execution halted
Here is my original equation:
ggplot(data = titanic , aes(x = Age)) +
geom_histogram(binwidth = 1, color = 'blue', fill = '#00FFFF') +
scale_x_continuous(limits = c(0, 85), breaks = seq(0, 85, 20)) +
xlab('Age of passengers') +
ylab('Number of passengers') +
facet_wrap(~Survived)