I'm using R Markdown to write a report and using this code to create a graph:
ggplot(dd, aes(x =timestamp, y =eventType)) +
geom_line()
I am getting the error message below:
Error in ggplot(dd, aes(x = timestamp, y = eventType)): could not find function "ggplot"
I have tried to specify the library(ggplot2) but that didn't help. Can anybody suggest anything? If I run the r code on its own it works fine. If I tried to knit as pdf it doesn't work. Thanks