From df6b334c6fe5e5f308d14aea985e537cbc04a713 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Sun, 30 Dec 2018 10:27:28 +0100 Subject: [PATCH] website update --- docs/articles/index.html | 1 - docs/extra.css | 8 +++ docs/extra.js | 10 ++- docs/index.html | 17 ++--- docs/news/index.html | 87 ++++++++++++------------ docs/pkgdown.yml | 4 +- docs/reference/ab_property.html | 8 +-- docs/reference/abname.html | 8 +-- docs/reference/age.html | 2 +- docs/reference/age_groups.html | 16 ++--- docs/reference/antibiotics.html | 6 +- docs/reference/as.atc.html | 10 +-- docs/reference/as.mic.html | 4 +- docs/reference/as.mo.html | 20 +++--- docs/reference/as.rsi.html | 8 +-- docs/reference/atc_property.html | 2 +- docs/reference/count.html | 28 ++++---- docs/reference/eucast_rules.html | 2 +- docs/reference/first_isolate.html | 24 +++---- docs/reference/freq.html | 16 ++--- docs/reference/get_locale.html | 2 +- docs/reference/ggplot_rsi.html | 50 +++++++------- docs/reference/index.html | 4 +- docs/reference/join.html | 8 +-- docs/reference/key_antibiotics.html | 16 ++--- docs/reference/kurtosis.html | 2 +- docs/reference/like.html | 6 +- docs/reference/mdro.html | 4 +- docs/reference/microorganisms.certe.html | 6 +- docs/reference/microorganisms.html | 6 +- docs/reference/microorganisms.old.html | 4 +- docs/reference/microorganisms.umcg.html | 4 +- docs/reference/mo_failures.html | 4 +- docs/reference/mo_property.html | 28 ++++---- docs/reference/mo_renamed.html | 4 +- docs/reference/portion.html | 58 ++++++++-------- docs/reference/read.4D.html | 2 +- docs/reference/resistance_predict.html | 12 ++-- docs/reference/rsi.html | 4 +- docs/reference/septic_patients.html | 22 +++--- docs/reference/skewness.html | 2 +- docs/reference/supplementary_data.html | 2 +- docs/sitemap.xml | 3 - pkgdown/extra.js | 10 +-- 44 files changed, 275 insertions(+), 269 deletions(-) diff --git a/docs/articles/index.html b/docs/articles/index.html index c3f4deeb..4c7e428d 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -163,7 +163,6 @@ diff --git a/docs/extra.css b/docs/extra.css index b59420c8..5c0cf18c 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -1,3 +1,11 @@ +/* class for footer */ +.university { + background-image: url(logo_rug.png); + height: 40px; + background-size: 160px; + background-repeat: no-repeat; +} + /* Supports icons for brand using font-awesome */ .fab { font-family: "Font Awesome 5 Brands" !important; diff --git a/docs/extra.js b/docs/extra.js index 14071dbf..fce10395 100644 --- a/docs/extra.js +++ b/docs/extra.js @@ -1,3 +1,11 @@ // Add updated Font Awesome 5.6.3 library $('head').append(''); -$('footer p').text($('footer p').text().replace('Developed by', 'Authors:')); + +/* edit footer */ +$( document ).ready(function() { + $('footer').html('

' + + $('footer .copyright p').html().replace("Developed by", + "AMR (for R). Developed at the University of Groningen.
Authors:") + + '

'); +//$('footer').prepend("
"); +}); diff --git a/docs/index.html b/docs/index.html index 40087613..13370fe0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -125,30 +125,26 @@

AMR is a free and open-source R package to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and to work with antibiotic properties by using evidence-based methods.

We created this package for academic research at the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG). We released this under the GNU General Public Licence v2.0 (GPL-2) which makes it free for everybody to use and distribute, for personal and commercial use, but it may not be used for patent purposes. Read further about our GPL-2 licence here.

This package is ready-to-use for a professional environment by specialists in the following fields:

-

Get this package

diff --git a/docs/news/index.html b/docs/news/index.html index 19be0fff..5ce3f2b1 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -180,13 +180,13 @@
  • Function age to calculate the (patients) age in years
  • Function age_groups to split ages into custom or predefined groups (like children or elderly). This allows for easier demographic antimicrobial resistance analysis per age group.
  • -

    Functions filter_first_isolate and filter_first_weighted_isolate() to shorten and fasten filtering on data sets with antimicrobial results, e.g.:

    -
    septic_patients %>% filter_first_isolate()
    +

    Functions filter_first_isolate and filter_first_weighted_isolate() to shorten and fasten filtering on data sets with antimicrobial results, e.g.:

    + +filter_first_isolate(septic_patients)

    is equal to:

  • @@ -242,6 +242,7 @@
  • Automatic parameter filling for mdro, key_antibiotics and eucast_rules
  • Updated examples for resistance prediction (resistance_predict function)
  • +
  • Fix for as.mic to support more values ending in (several) zeroes
  • @@ -296,30 +297,30 @@
  • Fewer than 3 characters as input for as.mo will return NA
  • Function as.mo (and all mo_* wrappers) now supports genus abbreviations with “species” attached

    -
    as.mo("E. species")        # B_ESCHR
    -mo_fullname("E. spp.")     # "Escherichia species"
    -as.mo("S. spp")            # B_STPHY
    -mo_fullname("S. species")  # "Staphylococcus species"
    +
  • Added parameter combine_IR (TRUE/FALSE) to functions portion_df and count_df, to indicate that all values of I and R must be merged into one, so the output only consists of S vs. IR (susceptible vs. non-susceptible)
  • Fix for portion_*(..., as_percent = TRUE) when minimal number of isolates would not be met
  • -
  • Added parameter also_single_tested for portion_* and count_* functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion +
  • Added parameter also_single_tested for portion_* and count_* functions to also include cases where not all antibiotics were tested but at least one of the tested antibiotics includes the target antimicribial interpretation, see ?portion
  • Using portion_* functions now throws a warning when total available isolate is below parameter minimum
  • Functions as.mo, as.rsi, as.mic, as.atc and freq will not set package name as attribute anymore
  • -
  • Frequency tables - freq(): +
  • Frequency tables - freq():
  • Support for (un)selecting columns:

  • Check for hms::is.hms @@ -340,7 +341,7 @@
  • Removed diacritics from all authors (columns microorganisms$ref and microorganisms.old$ref) to comply with CRAN policy to only allow ASCII characters
  • Fix for mo_property not working properly
  • Fix for eucast_rules where some Streptococci would become ceftazidime R in EUCAST rule 4.5
  • -
  • Support for named vectors of class mo, useful for top_freq() +
  • Support for named vectors of class mo, useful for top_freq()
  • ggplot_rsi and scale_y_percent have breaks parameter
  • @@ -400,16 +401,16 @@

    They also come with support for German, Dutch, French, Italian, Spanish and Portuguese:

    -
    mo_gramstain("E. coli")
    +
     

    Furthermore, former taxonomic names will give a note about the current taxonomic name:

    -
    mo_gramstain("Esc blattae")
    +
     
    @@ -422,15 +423,15 @@
     
     
  • Functions as.mo and is.mo as replacements for as.bactid and is.bactid (since the microoganisms data set not only contains bacteria). These last two functions are deprecated and will be removed in a future release. The as.mo function determines microbial IDs using Artificial Intelligence (AI):

    -
    as.mo("E. coli")
    +
     

    And with great speed too - on a quite regular Linux server from 2007 it takes us less than 0.02 seconds to transform 25,000 items:

    @@ -461,11 +462,11 @@
  • Added three antimicrobial agents to the antibiotics data set: Terbinafine (D01BA02), Rifaximin (A07AA11) and Isoconazole (D01AC05)
  • Added 163 trade names to the antibiotics data set, it now contains 298 different trade names in total, e.g.:

    -
    ab_official("Bactroban")
    +
    ab_official("Bactroban")
     # [1] "Mupirocin"
    -ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
    +ab_name(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
     # [1] "Mupirocin" "Amoxicillin" "Azithromycin" "Flucloxacillin"
    -ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
    +ab_atc(c("Bactroban", "Amoxil", "Zithromax", "Floxapen"))
     # [1] "R01AX06" "J01CA04" "J01FA10" "J01CF05"
  • For first_isolate, rows will be ignored when there’s no species available
  • @@ -477,13 +478,13 @@
  • Support for quasiquotation in the functions series count_* and portions_*, and n_rsi. This allows to check for more than 2 vectors or columns.

    -
  • Edited ggplot_rsi and geom_rsi so they can cope with count_df. The new fun parameter has value portion_df at default, but can be set to count_df.
  • Fix for ggplot_rsi when the ggplot2 package was not loaded
  • @@ -498,11 +499,11 @@
  • Support for types (classes) list and matrix for freq

    my_matrix = with(septic_patients, matrix(c(age, gender), ncol = 2))
    -freq(my_matrix)
    +freq(my_matrix)
  • For lists, subsetting is possible:

    my_list = list(age = septic_patients$age, gender = septic_patients$gender)
    -my_list %>% freq(age)
    -my_list %>% freq(gender)
    +my_list %>% freq(age) +my_list %>% freq(gender)
    @@ -544,7 +545,7 @@ @@ -565,7 +566,7 @@
  • Function ratio to transform a vector of values to a preset ratio
  • Support for Addins menu in RStudio to quickly insert %in% or %like% (and give them keyboard shortcuts), or to view the datasets that come with this package
  • @@ -576,13 +577,13 @@ diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 548eb3e7..7d0e471f 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,9 +1,7 @@ pandoc: 2.3.1 pkgdown: 1.3.0 pkgdown_sha: ~ -articles: - AMR: AMR.html - freq: freq.html +articles: [] urls: reference: https://msberends.gitlab.io/reference article: https://msberends.gitlab.io/articles diff --git a/docs/reference/ab_property.html b/docs/reference/ab_property.html index c19b6499..97b9e9e7 100644 --- a/docs/reference/ab_property.html +++ b/docs/reference/ab_property.html @@ -163,7 +163,7 @@
    -

    Use these functions to return a specific property of an antibiotic from the antibiotics data set, based on their ATC code. Get such a code with as.atc.

    +

    Use these functions to return a specific property of an antibiotic from the antibiotics data set, based on their ATC code. Get such a code with as.atc.

    @@ -188,11 +188,11 @@ x -

    a (vector of a) valid atc code or any text that can be coerced to a valid atc with as.atc

    +

    a (vector of a) valid atc code or any text that can be coerced to a valid atc with as.atc

    property -

    one of the column names of one of the antibiotics data set, like "atc" and "official"

    +

    one of the column names of one of the antibiotics data set, like "atc" and "official"

    language @@ -206,7 +206,7 @@

    See also

    -

    antibiotics

    +

    antibiotics

    Examples

    diff --git a/docs/reference/abname.html b/docs/reference/abname.html index c364a262..d77f8b64 100644 --- a/docs/reference/abname.html +++ b/docs/reference/abname.html @@ -163,7 +163,7 @@
    -

    Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from antibiotics.

    +

    Convert antibiotic codes to a (trivial) antibiotic name or ATC code, or vice versa. This uses the data from antibiotics.

    @@ -179,7 +179,7 @@ from, to -

    type to transform from and to. See antibiotics for its column names. WIth from = "guess" the from will be guessed from "atc", "certe" and "umcg". When using to = "atc", the ATC code will be searched using as.atc.

    +

    type to transform from and to. See antibiotics for its column names. WIth from = "guess" the from will be guessed from "atc", "certe" and "umcg". When using to = "atc", the ATC code will be searched using as.atc.

    textbetween @@ -193,11 +193,11 @@

    Source

    -

    antibiotics

    +

    antibiotics

    Details

    -

    The ab_property functions are faster and more concise, but do not support concatenated strings, like abname("AMCL+GENT".

    +

    The ab_property functions are faster and more concise, but do not support concatenated strings, like abname("AMCL+GENT".

    Examples

    diff --git a/docs/reference/age.html b/docs/reference/age.html index 8c5ec6d7..eb34b42a 100644 --- a/docs/reference/age.html +++ b/docs/reference/age.html @@ -188,7 +188,7 @@

    See also

    -

    age_groups to splits age into groups

    +

    age_groups to splits age into groups

    diff --git a/docs/reference/age_groups.html b/docs/reference/age_groups.html index aaee4aaf..3cfcdd2d 100644 --- a/docs/reference/age_groups.html +++ b/docs/reference/age_groups.html @@ -174,7 +174,7 @@ x -

    age, e.g. calculated with age

    +

    age, e.g. calculated with age

    split_at @@ -201,7 +201,7 @@

    See also

    -

    age to determine ages based on one or more reference dates

    +

    age to determine ages based on one or more reference dates

    Examples

    @@ -230,13 +230,13 @@ # resistance of ciprofloxacine per age group library(dplyr) septic_patients %>% - mutate(first_isolate = first_isolate(.)) %>% - filter(first_isolate == TRUE, - mo == as.mo("E. coli")) %>% - group_by(age_group = age_groups(age)) %>% - select(age_group, + mutate(first_isolate = first_isolate(.)) %>% + filter(first_isolate == TRUE, + mo == as.mo("E. coli")) %>% + group_by(age_group = age_groups(age)) %>% + select(age_group, cipr) %>% - ggplot_rsi(x = "age_group") + ggplot_rsi(x = "age_group") # } diff --git a/docs/reference/as.atc.html b/docs/reference/as.atc.html index 4bfdb41f..82bbf371 100644 --- a/docs/reference/as.atc.html +++ b/docs/reference/as.atc.html @@ -163,7 +163,7 @@
    -

    Use this function to determine the ATC code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and trade names.

    +

    Use this function to determine the ATC code of one or more antibiotics. The data set antibiotics will be searched for abbreviations, official names and trade names.

    @@ -188,13 +188,13 @@

    Details

    -

    Use the ab_property functions to get properties based on the returned ATC code, see Examples.

    +

    Use the ab_property functions to get properties based on the returned ATC code, see Examples.

    In the ATC classification system, the active substances are classified in a hierarchy with five different levels. The system has fourteen main anatomical/pharmacological groups or 1st levels. Each ATC main group is divided into 2nd levels which could be either pharmacological or therapeutic groups. The 3rd and 4th levels are chemical, pharmacological or therapeutic subgroups and the 5th level is the chemical substance. The 2nd, 3rd and 4th levels are often used to identify pharmacological subgroups when that is considered more appropriate than therapeutic or chemical subgroups. Source: https://www.whocc.no/atc/structure_and_principles/

    See also

    -

    antibiotics for the dataframe that is being used to determine ATCs.

    +

    antibiotics for the dataframe that is being used to determine ATCs.

    Examples

    @@ -212,8 +212,8 @@ # Use ab_* functions to get a specific property based on an ATC code Cipro <- as.atc("cipro") # returns `J01MA02` -ab_official(Cipro) # returns "Ciprofloxacin" -ab_umcg(Cipro) # returns "CIPR", the code used in the UMCG +ab_official(Cipro) # returns "Ciprofloxacin" +ab_umcg(Cipro) # returns "CIPR", the code used in the UMCG # } diff --git a/docs/reference/atc_property.html b/docs/reference/atc_property.html index a0a26ec3..6aef6af5 100644 --- a/docs/reference/atc_property.html +++ b/docs/reference/atc_property.html @@ -232,7 +232,7 @@

    Examples

    # NOT RUN {
     # What's the ATC of amoxicillin?
    -guess_atc("Amoxicillin")
    +guess_atc("Amoxicillin")
     # [1] "J01CA04"
     
     # oral DDD (Defined Daily Dose) of amoxicillin
    diff --git a/docs/reference/count.html b/docs/reference/count.html
    index b2849e8d..9dc60832 100644
    --- a/docs/reference/count.html
    +++ b/docs/reference/count.html
    @@ -191,7 +191,7 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_
         
         
           ...
    -      

    one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with as.rsi if needed.

    +

    one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with as.rsi if needed.

    also_single_tested @@ -199,11 +199,11 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_ data -

    a data.frame containing columns with class rsi (see as.rsi)

    +

    a data.frame containing columns with class rsi (see as.rsi)

    translate_ab -

    a column name of the antibiotics data set to translate the antibiotic abbreviations to, using abname. This can be set with getOption("get_antibiotic_names").

    +

    a column name of the antibiotics data set to translate the antibiotic abbreviations to, using abname. This can be set with getOption("get_antibiotic_names").

    combine_IR @@ -221,13 +221,13 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_

    Details

    -

    These functions are meant to count isolates. Use the portion_* functions to calculate microbial resistance.

    -

    n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

    -

    count_df takes any variable from data that has an "rsi" class (created with as.rsi) and counts the amounts of R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

    +

    These functions are meant to count isolates. Use the portion_* functions to calculate microbial resistance.

    +

    n_rsi is an alias of count_all. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to n_distinct. Their function is equal to count_S(...) + count_IR(...).

    +

    count_df takes any variable from data that has an "rsi" class (created with as.rsi) and counts the amounts of R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

    See also

    -

    portion_* to calculate microbial resistance and susceptibility.

    +

    portion_* to calculate microbial resistance and susceptibility.

    Examples

    @@ -251,17 +251,17 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_ # calculate back to count e.g. non-susceptible isolates. # This results in the same: count_IR(septic_patients$amox) -portion_IR(septic_patients$amox) * n_rsi(septic_patients$amox) +portion_IR(septic_patients$amox) * n_rsi(septic_patients$amox) library(dplyr) septic_patients %>% - group_by(hospital_id) %>% - summarise(R = count_R(cipr), + group_by(hospital_id) %>% + summarise(R = count_R(cipr), I = count_I(cipr), S = count_S(cipr), n1 = count_all(cipr), # the actual total; sum of all three n2 = n_rsi(cipr), # same - analogous to n_distinct - total = n()) # NOT the amount of tested isolates! + total = n()) # NOT the amount of tested isolates! # Count co-resistance between amoxicillin/clav acid and gentamicin, # so we can see that combination therapy does a lot more than mono therapy. @@ -279,13 +279,13 @@ count_R and count_IR can be used to count resistant isolates, count_S and count_ # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>% count_df(translate = FALSE) # It also supports grouping variables septic_patients %>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>% count_df(translate = FALSE) # }
    diff --git a/docs/reference/eucast_rules.html b/docs/reference/eucast_rules.html index d9174890..6ab01938 100644 --- a/docs/reference/eucast_rules.html +++ b/docs/reference/eucast_rules.html @@ -199,7 +199,7 @@ col_mo -

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    +

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    info diff --git a/docs/reference/first_isolate.html b/docs/reference/first_isolate.html index 04ab01bd..2ec70f00 100644 --- a/docs/reference/first_isolate.html +++ b/docs/reference/first_isolate.html @@ -198,7 +198,7 @@ col_mo -

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    +

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    col_testcode @@ -214,7 +214,7 @@ col_keyantibiotics -

    column name of the key antibiotics to determine first weighted isolates, see key_antibiotics. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use col_keyantibiotics = FALSE to prevent this.

    +

    column name of the key antibiotics to determine first weighted isolates, see key_antibiotics. Defaults to the first column that starts with 'key' followed by 'ab' or 'antibiotics' (case insensitive). Use col_keyantibiotics = FALSE to prevent this.

    episode_days @@ -291,7 +291,7 @@ To conduct an analysis of antimicrobial resistance, you should only include the

    See also

    -

    key_antibiotics

    +

    key_antibiotics

    Examples

    @@ -302,11 +302,11 @@ To conduct an analysis of antimicrobial resistance, you should only include the library(dplyr) # Filter on first isolates: septic_patients %>% - mutate(first_isolate = first_isolate(., + mutate(first_isolate = first_isolate(., col_date = "date", col_patient_id = "patient_id", col_mo = "mo")) %>% - filter(first_isolate == TRUE) + filter(first_isolate == TRUE) # Which can be shortened to: septic_patients %>% @@ -317,15 +317,15 @@ To conduct an analysis of antimicrobial resistance, you should only include the # Now let's see if first isolates matter: A <- septic_patients %>% - group_by(hospital_id) %>% - summarise(count = n_rsi(gent), # gentamicin availability - resistance = portion_IR(gent)) # gentamicin resistance + group_by(hospital_id) %>% + summarise(count = n_rsi(gent), # gentamicin availability + resistance = portion_IR(gent)) # gentamicin resistance B <- septic_patients %>% filter_first_weighted_isolate() %>% # the 1st isolate filter - group_by(hospital_id) %>% - summarise(count = n_rsi(gent), # gentamicin availability - resistance = portion_IR(gent)) # gentamicin resistance + group_by(hospital_id) %>% + summarise(count = n_rsi(gent), # gentamicin availability + resistance = portion_IR(gent)) # gentamicin resistance # Have a look at A and B. # B is more reliable because every isolate is only counted once. @@ -337,7 +337,7 @@ To conduct an analysis of antimicrobial resistance, you should only include the # }# NOT RUN { # set key antibiotics to a new variable -tbl$keyab <- key_antibiotics(tbl) +tbl$keyab <- key_antibiotics(tbl) tbl$first_isolate <- first_isolate(tbl) diff --git a/docs/reference/freq.html b/docs/reference/freq.html index 5f6bed31..bbeabe99 100644 --- a/docs/reference/freq.html +++ b/docs/reference/freq.html @@ -317,34 +317,34 @@ # you could also use `select` or `pull` to get your variables septic_patients %>% - filter(hospital_id == "A") %>% - select(mo) %>% + filter(hospital_id == "A") %>% + select(mo) %>% freq() # multiple selected variables will be pasted together septic_patients %>% left_join_microorganisms %>% - filter(hospital_id == "A") %>% + filter(hospital_id == "A") %>% freq(genus, species) # group a variable and analyse another septic_patients %>% - group_by(hospital_id) %>% + group_by(hospital_id) %>% freq(gender) # get top 10 bugs of hospital A as a vector septic_patients %>% - filter(hospital_id == "A") %>% + filter(hospital_id == "A") %>% freq(mo) %>% top_freq(10) # save frequency table to an object years <- septic_patients %>% - mutate(year = format(date, "%Y")) %>% + mutate(year = format(date, "%Y")) %>% freq(year) @@ -395,11 +395,11 @@ # only get selected columns septic_patients %>% freq(hospital_id) %>% - select(item, percent) + select(item, percent) septic_patients %>% freq(hospital_id) %>% - select(-count, -cum_count) + select(-count, -cum_count) # check differences between frequency tables diff --git a/docs/reference/get_locale.html b/docs/reference/get_locale.html index cd3df960..b19d7c1f 100644 --- a/docs/reference/get_locale.html +++ b/docs/reference/get_locale.html @@ -163,7 +163,7 @@
    -

    Determines the system language to be used for language-dependent output of AMR functions, like mo_gramstain and mo_type.

    +

    Determines the system language to be used for language-dependent output of AMR functions, like mo_gramstain and mo_type.

    diff --git a/docs/reference/ggplot_rsi.html b/docs/reference/ggplot_rsi.html index bca73c4b..8a068a95 100644 --- a/docs/reference/ggplot_rsi.html +++ b/docs/reference/ggplot_rsi.html @@ -193,11 +193,11 @@ data -

    a data.frame with column(s) of class "rsi" (see as.rsi)

    +

    a data.frame with column(s) of class "rsi" (see as.rsi)

    position -

    position adjustment of bars, either "fill" (default when fun is count_df), "stack" (default when fun is portion_df) or "dodge"

    +

    position adjustment of bars, either "fill" (default when fun is count_df), "stack" (default when fun is portion_df) or "dodge"

    x @@ -221,11 +221,11 @@ translate_ab -

    a column name of the antibiotics data set to translate the antibiotic abbreviations into, using abname. Default behaviour is to translate to official names according to the WHO. Use translate_ab = FALSE to disable translation.

    +

    a column name of the antibiotics data set to translate the antibiotic abbreviations into, using abname. Default behaviour is to translate to official names according to the WHO. Use translate_ab = FALSE to disable translation.

    fun -

    function to transform data, either count_df (default) or portion_df

    +

    function to transform data, either count_df (default) or portion_df

    nrow @@ -251,9 +251,9 @@

    Details

    -

    At default, the names of antibiotics will be shown on the plots using abname. This can be set with the option get_antibiotic_names (a logical value), so change it e.g. to FALSE with options(get_antibiotic_names = FALSE).

    +

    At default, the names of antibiotics will be shown on the plots using abname. This can be set with the option get_antibiotic_names (a logical value), so change it e.g. to FALSE with options(get_antibiotic_names = FALSE).

    The functions
    -geom_rsi will take any variable from the data that has an rsi class (created with as.rsi) using fun (count_df at default, can also be portion_df) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.

    +geom_rsi will take any variable from the data that has an rsi class (created with as.rsi) using fun (count_df at default, can also be portion_df) and will plot bars with the percentage R, I and S. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis.

    facet_rsi creates 2d plots (at default based on S/I/R) using facet_wrap.

    scale_y_percent transforms the y axis to a 0 to 100% range using scale_continuous.

    scale_rsi_colours sets colours to the bars: green for S, yellow for I and red for R, using scale_brewer.

    @@ -268,7 +268,7 @@ library(ggplot2) # get antimicrobial results for drugs against a UTI: -ggplot(septic_patients %>% select(amox, nitr, fosf, trim, cipr)) + +ggplot(septic_patients %>% select(amox, nitr, fosf, trim, cipr)) + geom_rsi() # prettify the plot using some additional functions: @@ -282,17 +282,17 @@ # or better yet, simplify this using the wrapper function - a single command: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi() # get only portions and no counts: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi(fun = portion_df) # add other ggplot2 parameters as you like: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi(width = 0.5, colour = "black", size = 1, @@ -301,25 +301,25 @@ # resistance of ciprofloxacine per age group septic_patients %>% - mutate(first_isolate = first_isolate(.)) %>% - filter(first_isolate == TRUE, - mo == as.mo("E. coli")) %>% + mutate(first_isolate = first_isolate(.)) %>% + filter(first_isolate == TRUE, + mo == as.mo("E. coli")) %>% # `age_group` is also a function of this package: - group_by(age_group = age_groups(age)) %>% - select(age_group, + group_by(age_group = age_groups(age)) %>% + select(age_group, cipr) %>% ggplot_rsi(x = "age_group") # }# NOT RUN { # for colourblind mode, use divergent colours from the viridis package: septic_patients %>% - select(amox, nitr, fosf, trim, cipr) %>% + select(amox, nitr, fosf, trim, cipr) %>% ggplot_rsi() + scale_fill_viridis_d() # it also supports groups (don't forget to use the group var on `x` or `facet`): septic_patients %>% - select(hospital_id, amox, nitr, fosf, trim, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, nitr, fosf, trim, cipr) %>% + group_by(hospital_id) %>% ggplot_rsi(x = hospital_id, facet = Antibiotic, nrow = 1) + @@ -329,22 +329,22 @@ # genuine analysis: check 2 most prevalent microorganisms septic_patients %>% # create new bacterial ID's, with all CoNS under the same group (Becker et al.) - mutate(mo = as.mo(mo, Becker = TRUE)) %>% + mutate(mo = as.mo(mo, Becker = TRUE)) %>% # filter on top three bacterial ID's - filter(mo %in% top_freq(freq(.$mo), 3)) %>% + filter(mo %in% top_freq(freq(.$mo), 3)) %>% # determine first isolates - mutate(first_isolate = first_isolate(., + mutate(first_isolate = first_isolate(., col_date = "date", col_patient_id = "patient_id", col_mo = "mo")) %>% # filter on first isolates - filter(first_isolate == TRUE) %>% + filter(first_isolate == TRUE) %>% # get short MO names (like "E. coli") - mutate(mo = mo_shortname(mo, Becker = TRUE)) %>% + mutate(mo = mo_shortname(mo, Becker = TRUE)) %>% # select this short name and some antiseptic drugs - select(mo, cfur, gent, cipr) %>% + select(mo, cfur, gent, cipr) %>% # group by MO - group_by(mo) %>% + group_by(mo) %>% # plot the thing, putting MOs on the facet ggplot_rsi(x = Antibiotic, facet = mo, diff --git a/docs/reference/index.html b/docs/reference/index.html index 0bf64584..6d9ee1ff 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -286,7 +286,7 @@ -

    Analysing the data

    +

    Analysing your data

    Functions for conducting AMR analysis

    @@ -436,7 +436,7 @@ diff --git a/docs/reference/join.html b/docs/reference/join.html index bac48017..aee46a33 100644 --- a/docs/reference/join.html +++ b/docs/reference/join.html @@ -163,7 +163,7 @@
    -

    Join the dataset microorganisms easily to an existing table or character vector.

    +

    Join the dataset microorganisms easily to an existing table or character vector.

    @@ -188,7 +188,7 @@ by -

    a variable to join by - if left empty will search for a column with class mo (created with as.mo) or will be "mo" if that column name exists in x, could otherwise be a column name of x with values that exist in microorganisms$mo (like by = "bacteria_id"), or another column in microorganisms (but then it should be named, like by = c("my_genus_species" = "fullname"))

    +

    a variable to join by - if left empty will search for a column with class mo (created with as.mo) or will be "mo" if that column name exists in x, could otherwise be a column name of x with values that exist in microorganisms$mo (like by = "bacteria_id"), or another column in microorganisms (but then it should be named, like by = c("my_genus_species" = "fullname"))

    suffix @@ -207,7 +207,7 @@

    Examples

    # NOT RUN {
    -left_join_microorganisms(as.mo("K. pneumoniae"))
    +left_join_microorganisms(as.mo("K. pneumoniae"))
     left_join_microorganisms("B_KLBSL_PNE")
     
     library(dplyr)
    @@ -216,7 +216,7 @@
     df <- data.frame(date = seq(from = as.Date("2018-01-01"),
                                 to = as.Date("2018-01-07"),
                                 by = 1),
    -                 bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR",
    +                 bacteria = as.mo(c("S. aureus", "MRSA", "MSSA", "STAAUR",
                                         "E. coli", "E. coli", "E. coli")),
                      stringsAsFactors = FALSE)
     colnames(df)
    diff --git a/docs/reference/key_antibiotics.html b/docs/reference/key_antibiotics.html
    index 1919773d..bf4c020d 100644
    --- a/docs/reference/key_antibiotics.html
    +++ b/docs/reference/key_antibiotics.html
    @@ -163,7 +163,7 @@
     
         
    -

    These function can be used to determine first isolates (see first_isolate). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates.

    +

    These function can be used to determine first isolates (see first_isolate). Using key antibiotics to determine first isolates is more reliable than without key antibiotics. These selected isolates will then be called first weighted isolates.

    @@ -187,7 +187,7 @@ col_mo -

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    +

    column name of the unique IDs of the microorganisms (see mo), defaults to the first column of class mo. Values will be coerced using as.mo.

    universal_1, universal_2, universal_3, universal_4, universal_5, universal_6 @@ -233,7 +233,7 @@

    Details

    -

    The function key_antibiotics returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using key_antibiotics_equal, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."). The first_isolate function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible S. aureus (MSSA) found within the same episode (see episode parameter of first_isolate). Without key antibiotic comparison it wouldn't.

    +

    The function key_antibiotics returns a character vector with 12 antibiotic results for every isolate. These isolates can then be compared using key_antibiotics_equal, to check if two isolates have generally the same antibiogram. Missing and invalid values are replaced with a dot ("."). The first_isolate function only uses this function on the same microbial species from the same patient. Using this, an MRSA will be included after a susceptible S. aureus (MSSA) found within the same episode (see episode parameter of first_isolate). Without key antibiotic comparison it wouldn't.

    At default, the antibiotics that are used for Gram positive bacteria are (colum names):
    "amox", "amcl", "cfur", "pita", "cipr", "trsu" (until here is universal), "vanc", "teic", "tetr", "eryt", "oxac", "rifa".

    At default, the antibiotics that are used for Gram negative bacteria are (colum names):
    @@ -251,7 +251,7 @@

    See also

    - +

    first_isolate

    Examples

    @@ -261,12 +261,12 @@ library(dplyr) # set key antibiotics to a new variable my_patients <- septic_patients %>% - mutate(keyab = key_antibiotics(.)) %>% - mutate( + mutate(keyab = key_antibiotics(.)) %>% + mutate( # now calculate first isolates - first_regular = first_isolate(., col_keyantibiotics = FALSE), + first_regular = first_isolate(., col_keyantibiotics = FALSE), # and first WEIGHTED isolates - first_weighted = first_isolate(., col_keyantibiotics = "keyab") + first_weighted = first_isolate(., col_keyantibiotics = "keyab") ) # Check the difference, in this data set it results in 7% more isolates: diff --git a/docs/reference/kurtosis.html b/docs/reference/kurtosis.html index 7bcbecdb..82f6e9e8 100644 --- a/docs/reference/kurtosis.html +++ b/docs/reference/kurtosis.html @@ -193,7 +193,7 @@

    See also

    - +

    skewness

    diff --git a/docs/reference/like.html b/docs/reference/like.html index 24cecf58..cdcdeda6 100644 --- a/docs/reference/like.html +++ b/docs/reference/like.html @@ -228,9 +228,9 @@ # get frequencies of bacteria whose name start with 'Ent' or 'ent' library(dplyr) septic_patients %>% - left_join_microorganisms() %>% - filter(genus %like% '^ent') %>% - freq(genus, species) + left_join_microorganisms() %>% + filter(genus %like% '^ent') %>% + freq(genus, species) # }
    diff --git a/docs/reference/microorganisms.certe.html b/docs/reference/microorganisms.certe.html index 105a42b2..0ee93698 100644 --- a/docs/reference/microorganisms.certe.html +++ b/docs/reference/microorganisms.certe.html @@ -163,7 +163,7 @@
    -

    A data set containing all bacteria codes of Certe MMB. These codes can be joined to data with an ID from microorganisms$mo (using left_join_microorganisms). GLIMS codes can also be translated to valid MOs with guess_mo.

    +

    A data set containing all bacteria codes of Certe MMB. These codes can be joined to data with an ID from microorganisms$mo (using left_join_microorganisms). GLIMS codes can also be translated to valid MOs with guess_mo.

    @@ -173,12 +173,12 @@

    A data.frame with 2,665 observations and 2 variables:

    certe

    Code of microorganism according to Certe MMB

    -
    mo

    Code of microorganism in microorganisms

    +
    mo

    Code of microorganism in microorganisms

    See also

    -

    as.mo microorganisms

    +

    as.mo microorganisms

    diff --git a/docs/reference/microorganisms.html b/docs/reference/microorganisms.html index d3803b57..9150aa4b 100644 --- a/docs/reference/microorganisms.html +++ b/docs/reference/microorganisms.html @@ -163,7 +163,7 @@
    -

    A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using as.mo.

    +

    A data set containing the complete microbial taxonomy of the kingdoms Bacteria, Fungi and Protozoa. MO codes can be looked up using as.mo.

    @@ -185,7 +185,7 @@
    subkingdom

    Taxonomic subkingdom of the microorganism as found in ITIS, see Source

    kingdom

    Taxonomic kingdom of the microorganism as found in ITIS, see Source

    gramstain

    Gram of microorganism, like "Gram negative"

    -
    prevalence

    An integer based on estimated prevalence of the microorganism in humans. Used internally by as.mo, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).

    +
    prevalence

    An integer based on estimated prevalence of the microorganism in humans. Used internally by as.mo, otherwise quite meaningless. It has a value of 25 for manually added items and a value of 1000 for all unprevalent microorganisms whose genus was somewhere in the top 250 (with another species).

    ref

    Author(s) and year of concerning publication as found in ITIS, see Source

    @@ -203,7 +203,7 @@ This package contains the complete microbial taxonomic data (wi

    See also

    -

    as.mo mo_property microorganisms.umcg

    +

    as.mo mo_property microorganisms.umcg

    diff --git a/docs/reference/microorganisms.old.html b/docs/reference/microorganisms.old.html index 787704dc..66928578 100644 --- a/docs/reference/microorganisms.old.html +++ b/docs/reference/microorganisms.old.html @@ -163,7 +163,7 @@
    -

    A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by as.mo.

    +

    A data set containing old (previously valid or accepted) taxonomic names according to ITIS. This data set is used internally by as.mo.

    @@ -192,7 +192,7 @@ This package contains the complete microbial taxonomic data (wi

    See also

    -

    as.mo mo_property microorganisms

    +

    as.mo mo_property microorganisms

    diff --git a/docs/reference/microorganisms.umcg.html b/docs/reference/microorganisms.umcg.html index 081b91d6..e17e9ef4 100644 --- a/docs/reference/microorganisms.umcg.html +++ b/docs/reference/microorganisms.umcg.html @@ -163,7 +163,7 @@
    -

    A data set containing all bacteria codes of UMCG MMB. These codes can be joined to data with an ID from microorganisms$mo (using left_join_microorganisms). GLIMS codes can also be translated to valid MOs with guess_mo.

    +

    A data set containing all bacteria codes of UMCG MMB. These codes can be joined to data with an ID from microorganisms$mo (using left_join_microorganisms). GLIMS codes can also be translated to valid MOs with guess_mo.

    @@ -178,7 +178,7 @@

    See also

    -

    as.mo microorganisms.certe microorganisms

    +

    as.mo microorganisms.certe microorganisms

    diff --git a/docs/reference/mo_failures.html b/docs/reference/mo_failures.html index ebd64bf2..47fd4c94 100644 --- a/docs/reference/mo_failures.html +++ b/docs/reference/mo_failures.html @@ -163,7 +163,7 @@
    -

    Returns a vector of all failed attempts to coerce values to a valid MO code with as.mo.

    +

    Returns a vector of all failed attempts to coerce values to a valid MO code with as.mo.

    @@ -171,7 +171,7 @@

    See also

    -

    as.mo

    +

    as.mo

    diff --git a/docs/reference/mo_property.html b/docs/reference/mo_property.html index bcc59e01..46fe045d 100644 --- a/docs/reference/mo_property.html +++ b/docs/reference/mo_property.html @@ -163,19 +163,19 @@
    -

    Use these functions to return a specific property of a microorganism from the microorganisms data set. All input values will be evaluated internally with as.mo.

    +

    Use these functions to return a specific property of a microorganism from the microorganisms data set. All input values will be evaluated internally with as.mo.

    -
    mo_fullname(x, language = get_locale(), ...)
    +    
    mo_fullname(x, language = get_locale(), ...)
     
    -mo_shortname(x, language = get_locale(), ...)
    +mo_shortname(x, language = get_locale(), ...)
     
    -mo_subspecies(x, language = get_locale(), ...)
    +mo_subspecies(x, language = get_locale(), ...)
     
    -mo_species(x, language = get_locale(), ...)
    +mo_species(x, language = get_locale(), ...)
     
    -mo_genus(x, language = get_locale(), ...)
    +mo_genus(x, language = get_locale(), ...)
     
     mo_family(x, ...)
     
    @@ -189,9 +189,9 @@
     
     mo_kingdom(x, ...)
     
    -mo_type(x, language = get_locale(), ...)
    +mo_type(x, language = get_locale(), ...)
     
    -mo_gramstain(x, language = get_locale(), ...)
    +mo_gramstain(x, language = get_locale(), ...)
     
     mo_TSN(x, ...)
     
    @@ -203,26 +203,26 @@
     
     mo_taxonomy(x, ...)
     
    -mo_property(x, property = "fullname", language = get_locale(), ...)
    +mo_property(x, property = "fullname", language = get_locale(), ...)

    Arguments

    - + - + - + - +
    x

    any (vector of) text that can be coerced to a valid microorganism code with as.mo

    any (vector of) text that can be coerced to a valid microorganism code with as.mo

    language

    language of the returned text, defaults to system language (see get_locale) and can also be set with getOption("AMR_locale"). Use language = NULL or language = "" to prevent translation.

    language of the returned text, defaults to system language (see get_locale) and can also be set with getOption("AMR_locale"). Use language = NULL or language = "" to prevent translation.

    ...

    other parameters passed on to as.mo

    other parameters passed on to as.mo

    property

    one of the column names of one of the microorganisms data set or "shortname"

    one of the column names of one of the microorganisms data set or "shortname"

    @@ -266,7 +266,7 @@ This package contains the complete microbial taxonomic data (wi

    See also

    -

    microorganisms

    +

    microorganisms

    Examples

    diff --git a/docs/reference/mo_renamed.html b/docs/reference/mo_renamed.html index 1c2d9758..6eb3562f 100644 --- a/docs/reference/mo_renamed.html +++ b/docs/reference/mo_renamed.html @@ -163,7 +163,7 @@
    -

    Returns a vector of all renamed items of the last coercion to valid MO codes with as.mo.

    +

    Returns a vector of all renamed items of the last coercion to valid MO codes with as.mo.

    @@ -171,7 +171,7 @@

    See also

    -

    as.mo

    +

    as.mo

    diff --git a/docs/reference/portion.html b/docs/reference/portion.html index 1e6fab8d..a48d0f8a 100644 --- a/docs/reference/portion.html +++ b/docs/reference/portion.html @@ -192,7 +192,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port ... -

    one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with as.rsi if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.

    +

    one or more vectors (or columns) with antibiotic interpretations. They will be transformed internally with as.rsi if needed. Use multiple columns to calculate (the lack of) co-resistance: the probability where one of two drugs have a resistant or susceptible result. See Examples.

    minimum @@ -208,11 +208,11 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port data -

    a data.frame containing columns with class rsi (see as.rsi)

    +

    a data.frame containing columns with class rsi (see as.rsi)

    translate_ab -

    a column name of the antibiotics data set to translate the antibiotic abbreviations to, using abname. This can be set with getOption("get_antibiotic_names").

    +

    a column name of the antibiotics data set to translate the antibiotic abbreviations to, using abname. This can be set with getOption("get_antibiotic_names").

    combine_IR @@ -231,10 +231,10 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port

    Details

    -

    Remember that you should filter your table to let it contain only first isolates! Use first_isolate to determine them in your data set.

    -

    These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the count functions to count isolates. Low counts can infuence the outcome - these portion functions may camouflage this, since they only return the portion albeit being dependent on the minimum parameter.

    -

    portion_df takes any variable from data that has an "rsi" class (created with as.rsi) and calculates the portions R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

    -

    The old rsi function is still available for backwards compatibility but is deprecated. +

    Remember that you should filter your table to let it contain only first isolates! Use first_isolate to determine them in your data set.

    +

    These functions are not meant to count isolates, but to calculate the portion of resistance/susceptibility. Use the count functions to count isolates. Low counts can infuence the outcome - these portion functions may camouflage this, since they only return the portion albeit being dependent on the minimum parameter.

    +

    portion_df takes any variable from data that has an "rsi" class (created with as.rsi) and calculates the portions R, I and S. The resulting tidy data (see Source) data.frame will have three rows (S/I/R) and a column for each variable with class "rsi".

    +

    The old rsi function is still available for backwards compatibility but is deprecated.

    To calculate the probability (p) of susceptibility of one antibiotic, we use this formula:

    @@ -250,7 +250,7 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port

    See also

    -

    count_* to count resistant and susceptible isolates.

    +

    count_* to count resistant and susceptible isolates.

    Examples

    @@ -274,58 +274,58 @@ portion_R and portion_IR can be used to calculate resistance, portion_S and port septic_patients %>% portion_SI(amox) septic_patients %>% - group_by(hospital_id) %>% - summarise(p = portion_S(cipr), - n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr + group_by(hospital_id) %>% + summarise(p = portion_S(cipr), + n = n_rsi(cipr)) # n_rsi works like n_distinct in dplyr septic_patients %>% - group_by(hospital_id) %>% - summarise(R = portion_R(cipr, as_percent = TRUE), + group_by(hospital_id) %>% + summarise(R = portion_R(cipr, as_percent = TRUE), I = portion_I(cipr, as_percent = TRUE), S = portion_S(cipr, as_percent = TRUE), - n = n_rsi(cipr), # works like n_distinct in dplyr - total = n()) # NOT the amount of tested isolates! + n = n_rsi(cipr), # works like n_distinct in dplyr + total = n()) # NOT the amount of tested isolates! # Calculate co-resistance between amoxicillin/clav acid and gentamicin, # so we can see that combination therapy does a lot more than mono therapy: septic_patients %>% portion_S(amcl) # S = 67.1% -septic_patients %>% count_all(amcl) # n = 1576 +septic_patients %>% count_all(amcl) # n = 1576 septic_patients %>% portion_S(gent) # S = 74.0% -septic_patients %>% count_all(gent) # n = 1855 +septic_patients %>% count_all(gent) # n = 1855 septic_patients %>% portion_S(amcl, gent) # S = 92.0% -septic_patients %>% count_all(amcl, gent) # n = 1517 +septic_patients %>% count_all(amcl, gent) # n = 1517 septic_patients %>% - group_by(hospital_id) %>% - summarise(cipro_p = portion_S(cipr, as_percent = TRUE), - cipro_n = count_all(cipr), + group_by(hospital_id) %>% + summarise(cipro_p = portion_S(cipr, as_percent = TRUE), + cipro_n = count_all(cipr), genta_p = portion_S(gent, as_percent = TRUE), - genta_n = count_all(gent), + genta_n = count_all(gent), combination_p = portion_S(cipr, gent, as_percent = TRUE), - combination_n = count_all(cipr, gent)) + combination_n = count_all(cipr, gent)) # Get portions S/I/R immediately of all rsi columns septic_patients %>% - select(amox, cipr) %>% + select(amox, cipr) %>% portion_df(translate = FALSE) # It also supports grouping variables septic_patients %>% - select(hospital_id, amox, cipr) %>% - group_by(hospital_id) %>% + select(hospital_id, amox, cipr) %>% + group_by(hospital_id) %>% portion_df(translate = FALSE) # }# NOT RUN { # calculate current empiric combination therapy of Helicobacter gastritis: my_table %>% - filter(first_isolate == TRUE, + filter(first_isolate == TRUE, genus == "Helicobacter") %>% - summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole - n = count_all(amox, metr)) + summarise(p = portion_S(amox, metr), # amoxicillin with metronidazole + n = count_all(amox, metr)) # } diff --git a/docs/reference/supplementary_data.html b/docs/reference/supplementary_data.html index dd10ec46..ad8bf49e 100644 --- a/docs/reference/supplementary_data.html +++ b/docs/reference/supplementary_data.html @@ -163,7 +163,7 @@
    -

    These data.tables are transformed from the microorganisms and microorganisms data sets to improve speed of as.mo. They are meant for internal use only, and are only mentioned here for reference.

    +

    These data.tables are transformed from the microorganisms and microorganisms data sets to improve speed of as.mo. They are meant for internal use only, and are only mentioned here for reference.

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 297a31dc..53d7f3cf 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -123,7 +123,4 @@ https://msberends.gitlab.io/articles/AMR.html - - https://msberends.gitlab.io/articles/freq.html - diff --git a/pkgdown/extra.js b/pkgdown/extra.js index b27a58a6..fce10395 100644 --- a/pkgdown/extra.js +++ b/pkgdown/extra.js @@ -2,8 +2,10 @@ $('head').append(''); /* edit footer */ -$('footer').html('

    ' + - $('footer .copyright p').html().replace("Developed by", - "AMR (for R). Developed at the University of Groningen.
    Authors:") + - '

    '); +$( document ).ready(function() { + $('footer').html('

    ' + + $('footer .copyright p').html().replace("Developed by", + "AMR (for R). Developed at the University of Groningen.
    Authors:") + + '

    '); //$('footer').prepend("
    "); +});