inbo / n2khab

R package with preprocessing functions and standard reference data for Flemish Natura 2000 (N2K) habitat (HAB) analyses
https://inbo.github.io/n2khab
GNU General Public License v3.0
2 stars 1 forks source link

Updates in generate_textdata #151

Closed florisvdh closed 3 years ago

florisvdh commented 3 years ago

Because the googlesheets package had stopped working, the code has been migrated to googlesheets4. Also, all gsheet-IDs are now defined in one chunk in index.Rmd.

Meanwhile, two data changes have taken place due to updates in gsheets:

@ToonHub can you update below code that you made earlier? By making a join between attribute_1 and code, it has been assumed that attribute_1 always refers to a type, the name of which is used to automatically generate scheme names in namelist. However, currently attribute_1 in the schemes_MHQ object contains a value 2190_terr as attribute_1.

https://github.com/inbo/n2khab/blob/86bd48ca4a2b6ad4386f01efd1e61b2a97e6dacc/misc/generate_textdata/30_schemes_and_scheme_types.Rmd#L569-L584

This currently leads to an erroneous last line in namelist.tsv:

https://github.com/inbo/n2khab/blob/googlesheets4_hq2190/inst/textdata/namelist.tsv#L612

In case you consider attribute_1 to no longer always be a type name, please also update this in the documentation of the schemes data source:

https://github.com/inbo/n2khab/blob/86bd48ca4a2b6ad4386f01efd1e61b2a97e6dacc/R/textdata.R#L244-L253

Preferably do these changes in a new pull request that branches from googlesheets4_hq2190 and that targets googlesheets4_hq2190, then you can add me as reviewer for that part.

Assuming that you'll need to do some steps interactively, or by compiling the bookdown yourself (in the generate_textdata project): renv's R version is now upgraded to 4.1.1 and the package versions are more recent (except git2rdata, which has been frozen at 0.2.1 in order to avoid re-sorting many rows). Anyway the renv::restore() line in index.Rmd should do its work.