CorrelAid / datenguideR

R wrapper for the datengui.de GraphQL API to easily access German regional statistics
GNU General Public License v3.0
26 stars 3 forks source link

create dg_regions from data-raw #11

Closed dpprdan closed 5 years ago

dpprdan commented 5 years ago

I assume that the regions.csv will seldomly get updated (well, everytime there is a Gebietsänderung, which are not sooo seldom), so this PR moves the script and source file that creates dg_regions.rda to data-raw (see R Packages: Exported data). The script will have to be run, everytime there is a change in regions.csv (and a new package version will have to be issued - but that would also be the case without this PR). Only when the script is run, dg_regions.rda is being updated, otherwise it will stay the same. This should make tests, R CMD check, devtools::load_all(), etc. faster.

Another reason for this is that I suspect (though I am not 100% sure) that using use_data() within the package code (and not only in a script in data-raw) is not allowed. ~Or rather I suspect it to be the reason behind the "Non-staged installation was used" NOTE I get from R CMD Check. For more "on staged installs" see Staged Install - The R Blog. Also~ notice that in the R packages chapter I reference above, use_data() is only used in scripts that reside in data-raw, which is .Rbuildignored.

~(I still get the NOTE, because of dg_descriptions, though).~

What is the source of the regions.csv, anyway? It could be documented with @source in data.R.

Finally, it is apparently not allowed to depend on an R version that does not have patchlevel 0, i.e. a package can depend on R v3.6.0 but not v3.6.1.

dpprdan commented 5 years ago

I was wrong about the StagedInstall. I missed the StagedInstall = no in DESCRIPTION, which was causing the NOTE. Staged installations are possible again with this PR though.