Is it possible to include .R files in the data directory of my package in the roxygen process?
I have put several .R files in the data directory. When they are sourced with data(), they read in raw data files and perform some transformations.
Creating Rd FilesUse the File -> New -> R Documentation command in RStudio. This command will allow you to specify the name of an existing function or dataset to use as the basis for the Rd file or alternatively will create a new empty Rd file.
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 in my package #' #' @name data-name #' @docType data #' @author My Name \email{blahblah@@roxygen.org} #' @references \url{data_blah.com} #' @keywords data NULL
As of roxygen2 >4.0.0, you can document the data object defined elsewhere by documenting the name of the object defined as a string:
#' This is data to be included in my package #' #' @author My Name \email{blahblah@@roxygen.org} #' @references \url{data_blah.com} "data-name"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With