1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 07:51:57 +02:00

(v0.6.1.9044) first_isolate fix for species

This commit is contained in:
2019-05-31 14:25:11 +02:00
parent 1f8ee3ec3e
commit 493ae2ba0c
121 changed files with 586 additions and 521 deletions

View File

@ -233,7 +233,7 @@ first_isolate <- function(x,
}
# -- specimen
if (is.null(col_specimen)) {
if (is.null(col_specimen) & !is.null(specimen_group)) {
col_specimen <- search_type_in_df(x = x, type = "specimen")
}
if (isFALSE(col_specimen)) {
@ -263,7 +263,9 @@ first_isolate <- function(x,
# join to microorganisms data set
x <- x %>%
mutate_at(vars(col_mo), as.mo) %>%
left_join_microorganisms(by = col_mo)
left_join_microorganisms(by = col_mo) %>%
# empty species will lead to first = FALSE, so put in text there if genus is available
mutate(species = ifelse(!is.na(genus) & species == "", "species", species))
col_genus <- "genus"
col_species <- "species"