#' @import dplyr
import_correspondances <- function() {
suppressMessages(
readr::read_delim(system.file("extdata",
"afb_amm_substance_cas_code_sandre.csv",
package = "bnvd"),
col_types = list(substance = readr::col_character(),
cas = readr::col_character(),
code_sandre = readr::col_character()),
delim = ";", locale = readr::locale(decimal_mark = ","))) %>%
select(substance, code_sandre) %>%
group_by(substance) %>%
group_modify(.f = function(df, ...) {
if (any(is.na(df$code_sandre)) & any(!is.na(df$code_sandre))) {
filter(df, !is.na(code_sandre))
} else {
df
}
}) %>%
distinct() %>%
bind_rows(.,
c(substance = "flupyrsulfuron-methyle",
code_sandre = "2565"),
c(substance = "huile blanche parafinique",
code_sandre = NA_character_),
c(substance = "valiphenal",
code_sandre = "8045"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.