knitr::opts_chunk$set(dev = 'svg')
packages <- c("tidyverse", "grateful", "eepR", "kableExtra", "DT") xfun::pkg_attach2(packages, message = F)
print("hello world")
si_platform <- sessioninfo::session_info()[["platform"]] %>% unlist() %>% as.data.frame() %>% rownames_to_column() colnames(si_platform) <- c("Setting", "Value") nice_table(si_platform)
si_packages <- sessioninfo::session_info()[["packages"]] %>% as_tibble() %>% mutate(package = ifelse(attached == TRUE, paste0(package, " *"), package)) %>% select(package, loadedversion, date, source) colnames(si_packages) <- c("Package", "Version", "Date", "Source") datatable(si_packages, caption = htmltools::tags$caption( style = "caption-side: bottom; text-align: left;", "Note: * Loaded R Packages"))
# this code was modified from the grateful package (see reference) # specifically, allows for additional citations (e.g, base R, RStudio, and rmarkdown) citations <- lapply(packages, citation) citations[[length(citations)+1]] <- citation('base') citations[[length(citations)+1]] <- rstudioapi::versionInfo()$citation citations[[length(citations)+1]] <- citation('rmarkdown') references <- c(packages, 'base', 'RStudio', 'rmarkdown') %>% unique() citations_bibtex <- lapply(citations, toBibtex) %>% unique() for (i in 1:length(citations)) { citations_bibtex[[i]] <- sub("\\{,", paste0("\\{", references[i], ","), citations_bibtex[[i]]) } writeLines(unlist(citations_bibtex), con = 'references.bib')
nocite: |
r paste0('@', references, collapse = ", ")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.