I'm on a Linux environment, and I'd like to make standalone HTML widgets in R using Leaflet and DT, and generating the HTML with htmlwidgets plugin. The problem is that when I try to open these generated HTML files, the browser is blank, and some sort of JSON parsing error occurs according to the console.
It only happens in Linux. I've already tried it on Windows with Rstudio, and it worked just fine.
I also found out that on Windows, the javascript widget is base64 encoded inside the HTML file, unlike on Linux.
I don't think it's a problem with htmlwidgets, since there are other widget libraries that I use (rPivotTable, plotly, etc.), and they work just fine on Linux with htmlwidgets.
R sessionInfo()
output:
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.4 LTS
The R packages and versions:
- plotly_4.5.6
- ggplot2_2.2.0
- rpivotTable_0.1.5.10
- htmlwidgets_0.8
- DT_0.1
- leaflet_1.0.1
Any idea what causes this? Have anyone ever experienced something similar? I've read questions with similar symptoms, but none of the answers solved the problem for me.