mirror of
https://github.com/msberends/AMR.git
synced 2025-07-08 12:31:58 +02:00
fix clipboard on linux
This commit is contained in:
38
R/data.R
38
R/data.R
@ -42,7 +42,7 @@
|
||||
#' @seealso \code{\link{microorganisms}}
|
||||
# last two columns created with:
|
||||
# antibiotics %>%
|
||||
# mutate(useful_gramnegative =
|
||||
# mutate(useful_gramnegative =
|
||||
# if_else(
|
||||
# atc_group1 %like% '(fusidic|glycopeptide|macrolide|lincosamide|daptomycin|linezolid)' |
|
||||
# atc_group2 %like% '(fusidic|glycopeptide|macrolide|lincosamide|daptomycin|linezolid)' |
|
||||
@ -116,39 +116,39 @@
|
||||
#' # ----------- #
|
||||
#' # PREPARATION #
|
||||
#' # ----------- #
|
||||
#'
|
||||
#'
|
||||
#' # Save this example dataset to an object, so we can edit it:
|
||||
#' my_data <- septic_patients
|
||||
#'
|
||||
#'
|
||||
#' # load the dplyr package to make data science A LOT easier
|
||||
#' library(dplyr)
|
||||
#'
|
||||
#'
|
||||
#' # Add first isolates to our dataset:
|
||||
#' my_data <- my_data %>%
|
||||
#' mutate(first_isolates = first_isolate(my_data, date, patient_id, bactid))
|
||||
#'
|
||||
#' my_data <- my_data %>%
|
||||
#' mutate(first_isolates = first_isolate(my_data, "date", "patient_id", "bactid"))
|
||||
#'
|
||||
#' # -------- #
|
||||
#' # ANALYSIS #
|
||||
#' # -------- #
|
||||
#'
|
||||
#' # 1. Get the amoxicillin resistance percentages
|
||||
#'
|
||||
#' # 1. Get the amoxicillin resistance percentages
|
||||
#' # of E. coli, divided by hospital:
|
||||
#'
|
||||
#'
|
||||
#' my_data %>%
|
||||
#' filter(bactid == "ESCCOL",
|
||||
#' first_isolates == TRUE) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' first_isolates == TRUE) %>%
|
||||
#' group_by(hospital_id) %>%
|
||||
#' summarise(n = n(),
|
||||
#' amoxicillin_resistance = rsi(amox))
|
||||
#'
|
||||
#'
|
||||
#' # 2. Get the amoxicillin/clavulanic acid resistance
|
||||
#'
|
||||
#'
|
||||
#' # 2. Get the amoxicillin/clavulanic acid resistance
|
||||
#' # percentages of E. coli, trend over the years:
|
||||
#'
|
||||
#' my_data %>%
|
||||
#'
|
||||
#' my_data %>%
|
||||
#' filter(bactid == guess_bactid("E. coli"),
|
||||
#' first_isolates == TRUE) %>%
|
||||
#' group_by(year = format(date, "%Y")) %>%
|
||||
#' first_isolates == TRUE) %>%
|
||||
#' group_by(year = format(date, "%Y")) %>%
|
||||
#' summarise(n = n(),
|
||||
#' amoxclav_resistance = rsi(amcl, minimum = 20))
|
||||
"septic_patients"
|
||||
|
Reference in New Issue
Block a user