I am not sure where the problem is so will describe it as much as I can. I am aware of this question, but not sure it applies to my case (Reduce file size of R Markdown HTML output)
I am generating an R html_notebook in a cluster and compared the output size with a one generated on a local machine. The one on a cluster comes always at 5 to 6 time more in size than the one generated on a local machine. For example, in one case, the size on a local machine is 16 Mb but the one from the cluster is at 76 Mb! I have a few long rmarkdown files to generate and wondered from where the issue comes.
Here are the specs of both machines:
- Local machine: windows 10, R version 4.0.2 (same with version 4), 64bit, RStudio version 1.3.959; rmarkdown: 2.3; Pandoc version 2.7.1.
- Cluster: CentOS Linux 7, Version 3.28.2, accessed via an HPC cluster. R version (4 cannot upgrade), 64bits, RStudio version 1.3.959; rmarkdown: 2.3; Pandoc version 2.7.1.
I tried with R 4 in both local and cluster, and same results.
In notebook, this is the part in the YAML: output: html_notebook: number_sections: true toc: true toc_depth: 6 toc_float: collapsed: true
I tried with an html_document and the same happened. I am generating the notebook as follows:
- Local machine: Opened in Rstudio, ran the code, then Knit, then save (haven't changed any settings)
- Cluster: ran following command: Rscript -e "rmarkdown::render('name.Rmd', clean=TRUE)"
I prefer to run on cluster as this is much quicker (2 hours in cluster with 44 cores; 24 hours or more on local machine :()
on local machine, png is used and on cluster it is svg files. But I am using plotly, and can save outputs as png.
Any suggestions?
Thanks and sorry for the long post