Data not found in documentation with roxygen2

I am working with library roxygen2

and devtools

. Build a package with the following structure:

  • Inside the / data folder , I have two .rda files with information about each dataset. Name them data1.rda

    and data2.rda

    .
  • Inside the / R folder , I have two files, one with the generated functions (and their explanation) and the other data.R with information about 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. Automatic update ... Error in get (name, envir = env): object 'data1' not found.

I've searched for similar questions with no answer to this problem. Anyone have a suggestion?

+3


source to share


2 answers


It might be a silly question, but are you using roxygenise in the downloaded package? This means you start first devtools::load_all()

and then roxygen2::roxygenise()

. I've seen a couple of people make this mistake on other posts.



+2


source


The method roxygen2::roxygenize

does not load the package as expected. But you can replace this step withdevtools::document(package_path)



0


source







All Articles