1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 13:42:04 +02:00

(v1.6.0.9065) unit tests

This commit is contained in:
2021-05-24 11:01:32 +02:00
parent 4fbf9e1720
commit e5599bc694
22 changed files with 126 additions and 133 deletions

View File

@ -202,34 +202,34 @@ if (require("ggplot2") & require("dplyr")) {
ggplot() +
geom_col(aes(x = x, y = y, fill = z)) +
scale_rsi_colours(Value4 = "S", Value5 = "I", Value6 = "R")
}
# resistance of ciprofloxacine per age group
example_isolates \%>\%
mutate(first_isolate = first_isolate(.)) \%>\%
filter(first_isolate == TRUE,
mo == as.mo("E. coli")) \%>\%
# age_groups() is also a function in this AMR package:
group_by(age_group = age_groups(age)) \%>\%
select(age_group,
CIP) \%>\%
ggplot_rsi(x = "age_group")
# resistance of ciprofloxacine per age group
example_isolates \%>\%
mutate(first_isolate = first_isolate()) \%>\%
filter(first_isolate == TRUE,
mo == as.mo("E. coli")) \%>\%
# age_groups() is also a function in this AMR package:
group_by(age_group = age_groups(age)) \%>\%
select(age_group,
CIP) \%>\%
ggplot_rsi(x = "age_group")
# a shorter version which also adjusts data label colours:
example_isolates \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi(colours = FALSE)
# a shorter version which also adjusts data label colours:
example_isolates \%>\%
select(AMX, NIT, FOS, TMP, CIP) \%>\%
ggplot_rsi(colours = FALSE)
# it also supports groups (don't forget to use the group var on `x` or `facet`):
example_isolates \%>\%
select(hospital_id, AMX, NIT, FOS, TMP, CIP) \%>\%
group_by(hospital_id) \%>\%
ggplot_rsi(x = "hospital_id",
facet = "antibiotic",
nrow = 1,
title = "AMR of Anti-UTI Drugs Per Hospital",
x.title = "Hospital",
datalabels = FALSE)
# it also supports groups (don't forget to use the group var on `x` or `facet`):
example_isolates \%>\%
select(hospital_id, AMX, NIT, FOS, TMP, CIP) \%>\%
group_by(hospital_id) \%>\%
ggplot_rsi(x = "hospital_id",
facet = "antibiotic",
nrow = 1,
title = "AMR of Anti-UTI Drugs Per Hospital",
x.title = "Hospital",
datalabels = FALSE)
}
}
}