Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

non standard file "data-raw" note on building/checking a package in R

Tags:

r

build

devtools

I get this warning

Non-standard file/directory found at top level:
  ‘data-raw’

when building my package, even there is the recommendation of creating this folder to create package data http://r-pkgs.had.co.nz/data.html#data-sysdata

Any comments on that or do I need a specific setting to get rid of this message.

like image 646
drmariod Avatar asked Jan 25 '17 15:01

drmariod


People also ask

How do I view data in an R package?

If you look at the package listing in the Packages panel, you will find a package called datasets. Simply check the checkbox next to the package name to load the package and gain access to the datasets. You can also click on the package name and RStudio will open a help file describing the datasets in this package.

What is Extdata R?

extdata: Extra data used to calculate ID numbers in Yassai et al.'s nomenclature.

How do I create an R package for data?

Creating a new R packageFile -> New Project -> New Directory -> R Package. Enter a name and folder for your package. Click “Create git repository” Click “Create Project” button to create your new project.


1 Answers

When used, data-raw should be added to .Rbuildignore. As explained in the Data section of Hadley's R-Packages book (also linked in the question)

Often, the data you include in data/ is a cleaned up version of raw data you’ve gathered from elsewhere. I highly recommend taking the time to include the code used to do this in the source version of your package. This will make it easy for you to update or reproduce your version of the data. I suggest that you put this code in data-raw/. You don’t need it in the bundled version of your package, so also add it to .Rbuildignore. Do all this in one step with:

usethis::use_data_raw()
like image 80
Gregor Thomas Avatar answered Oct 12 '22 16:10

Gregor Thomas