My rmarkdown output is html , creating a website using blogdown. I load the libraries at the top of each Rmd page by sourcing a script where they are listed. So when I end up with say 30 Rmd pages, that is loading the libraries 30 times whenever I build the site (which I appreciate I don't have to every time I update a file, but I do it regularly). As far as I have been able to work out there is no alternative to this - but I wonder if I am missing something obvious? Many thanks
If I had 30 Rmd files to generate and a large number of libraries and large data and memory intensive operations such that separately loading libraries in each Rmd were an issue, I'd bite the bullet and write the Rmd content to bring in library resources on an as-needed basis only
lubridate:ydm("2020--05-06")
or use {box} or write a custom package bringing into namespace library functions individually.