1
0
mirror of https://github.com/msberends/AMR.git synced 2025-09-06 06:49:41 +02:00

(v0.7.1.9063) septic_patients -> example_isolates

This commit is contained in:
2019-08-27 16:45:42 +02:00
parent 7a6fce4eb8
commit 93be16484b
92 changed files with 1143 additions and 818 deletions

View File

@@ -106,12 +106,12 @@ On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://
}
\examples{
# `septic_patients` is a dataset available in the AMR package. It is true, genuine data.
# See ?septic_patients.
# `example_isolates` is a dataset available in the AMR package.
# See ?example_isolates.
library(dplyr)
# Filter on first isolates:
septic_patients \%>\%
example_isolates \%>\%
mutate(first_isolate = first_isolate(.,
col_date = "date",
col_patient_id = "patient_id",
@@ -119,19 +119,19 @@ septic_patients \%>\%
filter(first_isolate == TRUE)
# Which can be shortened to:
septic_patients \%>\%
example_isolates \%>\%
filter_first_isolate()
# or for first weighted isolates:
septic_patients \%>\%
example_isolates \%>\%
filter_first_weighted_isolate()
# Now let's see if first isolates matter:
A <- septic_patients \%>\%
A <- example_isolates \%>\%
group_by(hospital_id) \%>\%
summarise(count = n_rsi(GEN), # gentamicin availability
resistance = portion_IR(GEN)) # gentamicin resistance
B <- septic_patients \%>\%
B <- example_isolates \%>\%
filter_first_weighted_isolate() \%>\% # the 1st isolate filter
group_by(hospital_id) \%>\%
summarise(count = n_rsi(GEN), # gentamicin availability