'R-Package Building: How to Modify @source Line While Documenting Data to be Included in My R Package
I am trying to include data in a package I am just building, I included the data object as follows:
set.seed(289805)
x <- room(10, mean = 0, var = 1)
I got assistance from This Page where I got a sample of code to modify. Here is the documentation jargon stored in the \R
folder in data.R
bellow:
#' Prices of 50,000 round cut diamonds.
#'
#' A dataset containing the prices and other attributes of almost 54,000
#' diamonds.
#'
#' @format A data frame with 53940 rows and 10 variables:
#' \describe{
#' \item{price}{price, in US dollars}
#' \item{carat}{weight of the diamond, in carats}
#' ...
#' }
#' @source \url{http://www.diamondse.info/}
"diamonds"
Since my data does not come from any web address I think I can not use \url{}
. The data I am using is simulated data just like this:
set.seed(289805)
x <- room(10, mean = 0, var = 1)
What I Want
What will I use instead of \url{}
in the #' @source \url{http://www.diamondse.info/}
line?
Solution 1:[1]
Hopefully you have found a solution by now. I ran into the same problem.
I found that @source
is roxygen2 code that gets converted to Rd documentation. Along the way I found R-Bloggers description of the \source
term for Rd documentation where they used "synthetic" to describe the source of their data.
So from what I can tell this is just a text field for describing where the data came from. The \url
markup just helps with formatting. In your case I would use something like:
#' @source Simulated data generated with the following code:
#' set.seed(289805)
#' x <- room(10, mean = 0, var = 1)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | c-petersen |