The purpose of directRoxy is to directly generate Rd and HTML files from R scripts with roxygen2 comments without having the scripts be in an R package
devtools::install_github("mimikwang/directRoxy")
library(directRoxy)
First, add roxygen2 tags to your script.
#' @name script
#'
#' @title script
#'
#' @description Description here
#'
#' @details Details here
#'
#' @param x, character, to be printed
#'
#' @return
#' A character matching input x
#'
#' @examples
#' script(x)
script <- function(x) {
print(x)
}
Next, use roxy2Rd
to generate Rd files or roxy2HTML
to generate HTML files.
roxy2Rd("script.R", "/output/path")
roxy2HTML("script.R", "/output/path")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.