Commit e7377d29 authored by Pauline Maury Laribière's avatar Pauline Maury Laribière
Browse files

extending post processing to non level 1 start

parent 8a063f48
Pipeline #270027 passed with stage
in 1 minute and 1 second
......@@ -18,5 +18,4 @@ export(get_identifier_content)
export(get_nomenclature_multiple_levels)
export(get_nomenclature_one_level)
export(get_nomenclature_path_nodes)
export(hash_to_string)
export(query_nomenclature)
......@@ -23,7 +23,7 @@ get_codelist <- function(identifier,
api <- api_class(
api_type = "codelist",
export_format = export_format,
parameters = glue("annotations={tolower(annotations)}"),
parameters = glue::glue("annotations={tolower(annotations)}"),
id = identifier
)
api$get_response()
......@@ -225,12 +225,11 @@ get_nomenclature_multiple_levels <- function(identifier,
# fill sub groups rows with parent group's values (instead of NA)
nb_col <- level_to - level_from + 1
group_columns <- names(res)[1:nb_col]
res[[group_columns[[1]]]] <- data.table::nafill(res[[group_columns[[1]]]], type="locf")
res[group_columns[(level_from + 1):level_to]] <- res %>%
group_by(group_columns[[level_from]]) %>%
subset(select=group_columns[(level_from + 1):level_to]) %>%
res[group_columns[2:(level_to - level_from + 1)]] <- res %>%
group_by(group_columns[1]) %>%
subset(select=group_columns[2:(level_to - level_from + 1)]) %>%
data.table::nafill(type="locf")
res
......
......@@ -11,12 +11,18 @@ knitr::opts_chunk$set(echo = TRUE)
# Installation
To install the library: # source stuff
You can install the library with
```{r cars}
summary(cars)
```{r install}
install.packages("fso_metadata")
```
then at the beginning of your R script, you will need to
```{r library}
library("fso_metadata")
```
# Available everywhere with the interoperability plateform (i14y)
## Code list
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment