Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates in generate_textdata #151

Merged
merged 10 commits into from
Sep 23, 2021
Merged

Conversation

florisvdh
Copy link
Member

@florisvdh florisvdh commented Sep 20, 2021

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:

  • a few English type name updates by S. De Saeger
  • scheme HQ2190 has been split into two schemes

@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.

Appending MHQ names for `scheme`.
```{r message=FALSE}
namelist <- read_vc(namelist_path, root)
schemes_MHQ_names <- schemes_MHQ %>%
left_join(namelist, by = c("attribute_1" = "code")) %>%
mutate(name = paste(ifelse(lang == "en",
"Habitat quality scheme:",
"Meetnet habitatkwaliteit:"),
shortname),
shortname = paste(ifelse(lang == "en",
"Habitat quality scheme",
"Meetnet habitatkwaliteit"),
attribute_1)) %>%

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:

n2khab/R/textdata.R

Lines 244 to 253 in 86bd48c

#' \item{attribute_1}{The first defining attribute of the scheme.
#' Typically, the code is explained by \code{\link{namelist}}.
#' Is a factor.
#' \itemize{
#' \item{In MNE, this is used to declare the 'compartment superscheme' (scheme
#' collection) to which the scheme belongs, and which is named after the
#' environmental compartment (however note that the surfacewater superscheme
#' comprises two environmental compartments).}
#' \item{In MHQ, this is used to define the target habitat type of the
#' monitoring scheme.}

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.

We still exclude git2rdata since it causes at the same time extensive reordering of namelist
- A few type name updates by S. De Saeger
- Scheme HQ2190 has been split in two schemes. Note that this currently poses an error in the namelist (see last line).
@florisvdh florisvdh requested a review from ToonHub September 20, 2021 16:59
@florisvdh florisvdh merged commit ee4d6c2 into dev_nextrelease Sep 23, 2021
@florisvdh florisvdh deleted the googlesheets4_hq2190 branch September 23, 2021 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants