yihui/blogdown-jekyll

could not find function "setRefClass"

haroldkyle opened this issue · 3 comments

Using a reference class causes an error when serving jekyll pages:
Error in eval(expr, envir, enclos): could not find function "setRefClass"

Interestingly, the RMarkdown script works fine otherwise, when running in the RStudio IDE and when generating a PDF from knitr. Any reason reference classes would fail with servr::jekyll() ?

I think you need library(methods) before you use setRefClass. Rscript does not load the methods package by default. It saves a few milliseconds in the startup time, but has wasted humans many hours answering this question 😭

Very helpful, that worked. Thank you so much!

This worked for me as well while connecting R Script from Power BI