roxygen
generate markdown comments within for loop
I think you can obtain what you want in knitr with the code chunk option results=”asis” that you can specify after “#+” in an R script to be passed to spin (but the code looks less “clean” than the interesting brew solution proposed by @daroczig): #+ results=”asis”, echo = FALSE for (i in 1:5) { … Read more
How can I document data sets with roxygen?
Roxygen can be used anywhere within an R file (in other words, it doesn’t have to be followed by a function). It can also be used to document any docType in the R documentation. So you can just document your data in a separate block (something like this): #’ This is data to be included … Read more
Roxygen2 – how to properly document S3 methods
As of roxygen2 >3.0.0, you only need @export: #’ A description of MyHappyFunction #’ #’ A details of MyHappyFunction #’ #’ @title MyHappyFunction: The my happy function #’ @param x numeric number #’ @param … other arguments #’ @examples #’ a <- 1 #’ class(a) <- “lm” #’ MyHappyFunction(a) #’ @export MyHappyFunction <- function(x, …){ … Read more