I keep getting this error when trying to knit HTML document using R Markdown.
"Quitting from lines 51-56 (UGRP-Comaparison.Rmd) Error in histogram(~age | role, data = combined, main = "Age Lattice Histogram", : could not find function "histogram" Calls: ... handle -> withCallingHandlers -> withVisible -> eval -> eval Execution halted"
But when I remove this code, I'm able to knit the document perfectly well. For reference, this is the code that is causing this issue:
histogram(~ age | role, data = combined,
main = "Age Lattice Histogram",
xlab = "Age",
ylab = "Frequency",
col = c("chocolate2", "seagreen"))
Note that when I'm able to run the code (it works and shows exactly the histogram that I'm trying to plot); but I'm just not able to knit it.
Thanks for your help in advance!