#' Coerce sessionInfo to Tidy Data.frame
#'
#' Useful for displaying tidy session info in Rmarkdown (HTML)
#'
#' Mostly this is useful for reproducibility and reporting in
#' a research article's supplemental information.
#'
#' @param x a \code{sessionInfo} object
#' @param pkgs a vector of package names
#'
#' @return A tidy \code{tibble} of package information.
#' @export
#'
#' @importFrom magrittr %>%
#'
#' @examples
#'
tidy_session <- function(){
bob <- sessionInfo()
packages <- bob$otherPkgs %>%
lapply(unclass) %>%
lapply(tibble::as_tibble) %>%
dplyr::bind_rows()
list(rversion = bob$R.version$version.string,
rnickname = bob$R.version$nickname,
os = bob$running,
packages = packages)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.