Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data not found in documentation with roxygen2

I am working with roxygen2 library and devtools. Building a package with the following structure:

  • Inside /data folder I have two .rda files with the information of each dataset. Let's call them 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?

like image 792
R18 Avatar asked Oct 17 '22 13:10

R18


1 Answers

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.

like image 176
FilipeTeixeira Avatar answered Oct 21 '22 06:10

FilipeTeixeira