knitr::opts_chunk$set(echo = TRUE, eval = FALSE)
Get started with the package usethis
and the function use_vignette
:
library(usethis) usethis::use_vignette("report")
To render the vignette to pdf, you'll need rmarkdown
and run from R:
# install the package first if necessary # install.packages("rmarkdown") rmarkdown::render("vignettes/report.Rmd", output_format="pdf_document")
The following function displays packages that are loaded in the R environment.
my_packages <- library()$results[,1] head(my_packages, 10)
my_packages
To install phyloch
we will use the package devtools
.
install.packages("devtools")
Then we can install phyloch
from Github.
devtools::install_github("fmichonneau/phyloch") #ERROR: lazy loading failed for package 'phyloch' #* removing 'C:/Users/randy/OneDrive/Documents/R/win-library/4.0/phyloch'
We will use an R package called pkgdown
for this.
We took the following instructions from https://pkgdown.r-lib.org/:
Get started with use_pkgdown
. Run it once to configure your package to use pkgdown
usethis::use_pkgdown()
Use build_site
to update your website:
# Run to build the website pkgdown::build_site()
Now, your website will be built in the docs
folder. Make sure that the folder is not in .gitignore
.
Otherwise, it will not be uplodaded to GitHub and the website will not be available publicly!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.