brendan-r / brocks

:eyeglasses: Miscellaneous R Functions
8 stars 9 forks source link

Unable to load Leaflet.js nor Three.js #8

Open angel-mora opened 3 years ago

angel-mora commented 3 years ago

Hello @brendan-r !

I've been following your solution for creating interactive charts directly from RStudio and Jekyll. I am still a humble apprentice regarding R and all its configuration possibilities. The issue I am facing is not being able to run 2/3 of the charts you have in the example post. I serve jekyll with

brocks::blog_serve()

I get the following message

Warning message:
In normalizePath(dirname(f)) : path[1]="NA": No such file or directory

but still able to run the site.

Can we get htmlwidgets to work?

When I go to the article above I see the first chart but for the next one

## Error in loadNamespace(name): there is no package called 'webshot'

And I've been stuck in here ever since. I have a couple of hypothesis but honestly there seem to be so many paths that I don't know which one to choose.

  1. Webshot is the issue. I installed all required dependencies and familiar packages from CRAN, ran library(webshot) before running brocs::blog_serve(), install ImageMagick and PhantomJS and classical debugging like using or removing quotes.
  2. Different version of RTools. I regularly get a message from different versions but haven't had issues with any other library or package.
  3. build.R file should have my jekyll source path explicitly declared though I don't really know how to check those knitr or rmardown config files inside RStudio. Or maybe the fact that brocks::blog_serve() works but brocks::blog_gen() does not. Here I guess RStudio is serving some cached .site folder but not actually rebuilding jekyll to show the rmd example file work after webshot and the other libraries (such as igraph) called. I have gotten the error jekyll_build() function does not exist as well.

Thanks in advance!

brendan-r commented 3 years ago

Angel, I am both flattered and astonished that anyone is still running this code!

Much has changed in the last few years, including Yihui himself writing a real Rmarkdown blogging engine: https://github.com/rstudio/blogdown

I'm afraid my recommendation would be to give-up on using my 5-year-old hacks, and use blogdown instead.

On the error, AFAICT the brocks::blog_* functions do not alter library paths. I'm afraid all I can suggest to resolve your problem would be to continuously reduce and simplify the code until you can identify the source of the problem. The functions in this package are very minor wrapper functions around other parts of Yihui's packages (as they were 5 years ago).

Sorry I can't be more help! 🤦