I am working with roxygen2
library and devtools
. Building a package with the following structure:
data1.rda
and data2.rda
. Inside /R folder I have two files, one with the functions created (and their explanation) and another one called data.R with the information of each dataset.
#' Description 1 #' #' Simple definition #' #' @format The \\code{data.frame} contains 2 variables: #' \\describe{ #' \\item{a}{The first variable.} #' \\item{b}{The second variable.} #' } "data1"
When I run roxygen2::roxygenize()
I get this message:
First time using roxygen2. Upgrading automatically... Error in get(name, envir = env) : object 'data1' not found.
I have looked for similar questions, without an answer for this problem. Anyone has a suggestion?
It might be a silly question but are you running roxygenise on your loaded package? Meaning that you first run devtools::load_all()
, and then roxygen2::roxygenise()
. I've seen a couple of people making this mistake on other posts.
The roxygen2::roxygenize
method does not load the package properly. But you can replace this step with devtools::document(package_path)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.