问题
Rstudio will not knit. I have been using it for a few weeks in a course.
When I try to knit it executes until it comes to some code and it stops. The code is
ggplot(data = gss, aes(x = year, fill = degree)) + geom_bar()
The message is
could not find function "ggplot"
This happens with other functions as well. With the code commented out is will run and produce an HTML file.
I have reinstalled R and Rstudio twice. I have had difficulty with my AV software (Bitdefender) blocking the install of some of the apps. The software is a new version updated a couple of weeks ago.
回答1:
Please load the package in the document (R Markdown? You didn't say) before you use any functions in it, e.g., library(ggplot2)
.
来源:https://stackoverflow.com/questions/47685616/rstudio-will-not-knit