So i prepared notebook in R and then knitted it to html. Everything was perfectly fine, but later on when i updated data, so i changed one line of code, i started to get error:
Error in ggplot(data = mydata, aes(x = fct_infreq(as.factor(worker)))):
could not find function "ggplot" Calls: <Annonymous> ... handle
-> withCallingHandlers -> withvisible -> eval ->eval
However, when i coppied the whole script to the notebok and created a preview it works perfeclty well, and also when i run this ggplot function separately it works.
ggplot(data = mydata, aes(x = fct_infreq(as.factor(worker)))) +
geom_bar(width = 0.5, color = "blue") +
labs(x ="Worker", y = "Answers") +
geom_text(stat ='count', aes(label = ..count.., vjust =-0.5)) +
ggtitle("Total iterations")
The question is: why knitting to HTML doesnt work for me and what i am missing here
thanks!