Hello. I am trying to render my Quarto document, but it keeps giving me this error :
"! could not find function "ggplot"
Quitting from lines 113-115 [unnamed-chunk-8] (k.qmd)
Execution halted"
I haven't been using R for long, and it was previously working just fine with me. I checked all my codes and there's no mistakes in them. If all my codes are correct, what should I do?
Thing is, when you compile a quarto document, it happens in a fresh environment: everything you ran in the console is temporarily forgotten (which is important for reproducibility).
I would suggest adding an additional library(ggplot2) in the same code chunk as the first ggplot() call, immediately before it. If that works, it will help pinpoint the problem.
If you're encountering an error stating that R could not find the function "ggplot," it typically indicates that the required package, in this case, "ggplot2," is not installed or loaded in your R environment.