So I'm going through Hadley Wickham's "R for Data Science" book, and I'm very early on. I did the first 5 exercises that start on page 6. I'm a decently experienced R user, but I've never really received an error like this before (see screenshot).
Before posting, I searched for similar questions/answers such as:
- could not find function "ggplot" -Rstudio cloud
- could not find function "ggplot"
For those posts, the problem either seemed to be that the ggplot2 package wasn't loaded into the environment, or a possible workspace image directory thing being saved but the packages not.
I tried closing R Studio and not saving the workspace image, then reopening the markdown file I've created storing all the code. All I'm trying to do is knit the HTML file and see what I've got so far. I have also tried making sure that the packages are loaded in. When I quit out of R and didn't save the workspace image, upon reopening R Studio, the first things I did were type "library(ggplot2)" and "library(tidyverse)" (without the quote marks obviously) but that still didn't fix my issue. Is there something I'm missing or overlooking in the above linked posts? In case it matters (because apparently there are situations where it sometimes does I guess?), I am on macbook pro with Big Sur. Ultimately, I am asking the questions, "Why am I getting this error and what is the fix?"
Thanks for taking the time to read my question!