Html output takes too long to load

前端 未结 2 1794
北恋
北恋 2021-01-24 17:24

I have this html knit output from Rmarkdown but since it is pretty heavy (it is an online guide), the page takes too long to show up when opening the link. I tried to divide the

2条回答
  •  暖寄归人
    2021-01-24 18:13

    Probably the best way to speed things up is to break up your web site into multiple pages. You can use the blogdown package to support this, but for a first try, it's even easier to use an RStudio site generator. Here are the steps:

    1. Create a new RStudio project; choose "Simple R Markdown website" for the type of project. This automatically creates three files, _site.yml, about.Rmd, index.Rmd.

    2. Decide how you want to break up the files into separate pages, and create .Rmd files for each one. The headers should be similar to the ones in about.Rmd and index.Rmd, and you should add lines to _site.yml for each page.

    3. Click on "Build website" in the Build pane (usually top right in RStudio). This will process all of the files and open the website at the index page.

    The HTML files will be stored in the _site folder within your project; you can copy them from there to your web server.

提交回复
热议问题