R has a huge community.
Many R users just ask questions on websites like StackOverflow.com , the largest
-online community for programmers. At the time of writing, 489 114
+online community for programmers. At the time of writing, 489 583
R-related questions have already been asked on this platform (that
covers questions and answers for any programming language). In my own
experience, most questions are answered within a couple of
diff --git a/articles/WHONET.html b/articles/WHONET.html
index aa2d39e9..666e0abb 100644
--- a/articles/WHONET.html
+++ b/articles/WHONET.html
@@ -38,7 +38,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/articles/datasets.html b/articles/datasets.html
index 260d7439..a1b08d87 100644
--- a/articles/datasets.html
+++ b/articles/datasets.html
@@ -38,7 +38,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -176,7 +176,7 @@
-
AMR 2.0.0.9015
+
AMR 2.0.0.9018
-
Changed
+
Changed
Added oxygen tolerance to over 25,000 bacteria in the microorganisms
data set
Added LPSN and GBIF identifiers, and oxygen tolerance to mo_info()
-formatting fix for sir_interpretation_history()
-
-Fixed some WHONET codes for microorganisms and consequently a couple of entries in clinical_breakpoints
-
+Added SAS Transport files (file extension .xpt
) to our download page to use in SAS software
Added microbial codes for Gram-negative/positive anaerobic bacteria
mo_rank()
now returns NA
for ‘unknown’ microorganisms (B_ANAER
, B_ANAER-NEG
, B_ANAER-POS
, B_GRAMN
, B_GRAMP
, F_FUNGUS
, F_YEAST
, and UNKNOWN
)
+Fixed formatting for sir_interpretation_history()
+
+Fixed some WHONET codes for microorganisms and consequently a couple of entries in clinical_breakpoints
+
Fixed a bug for as.mo()
that led to coercion of NA
values when using custom microorganism codes
-Added SAS Transport files (file extension .xpt
) to our download page to use in SAS software
+Fixed usage of icu_exclude
in first_isolates()
+
diff --git a/pkgdown.yml b/pkgdown.yml
index a98c6945..937c0d3e 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -11,7 +11,7 @@ articles:
datasets: datasets.html
resistance_predict: resistance_predict.html
welcome_to_AMR: welcome_to_AMR.html
-last_built: 2023-05-12T08:39Z
+last_built: 2023-05-17T20:16Z
urls:
reference: https://msberends.github.io/AMR/reference
article: https://msberends.github.io/AMR/articles
diff --git a/reference/AMR-deprecated.html b/reference/AMR-deprecated.html
index 654b143e..9ba6f1ec 100644
--- a/reference/AMR-deprecated.html
+++ b/reference/AMR-deprecated.html
@@ -10,7 +10,7 @@
AMR (for R)
-
2.0.0.9015
+
2.0.0.9018
diff --git a/reference/AMR-options.html b/reference/AMR-options.html
index 57578fbc..bbbad539 100644
--- a/reference/AMR-options.html
+++ b/reference/AMR-options.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/AMR.html b/reference/AMR.html
index 3c31ce03..d8de7485 100644
--- a/reference/AMR.html
+++ b/reference/AMR.html
@@ -24,7 +24,7 @@ The AMR package is available in English, Chinese, Czech, Danish, Dutch, Finnish,
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/Rplot005.png b/reference/Rplot005.png
index 964a8e11..2e237c96 100644
Binary files a/reference/Rplot005.png and b/reference/Rplot005.png differ
diff --git a/reference/Rplot006.png b/reference/Rplot006.png
index 3c448326..960f8689 100644
Binary files a/reference/Rplot006.png and b/reference/Rplot006.png differ
diff --git a/reference/Rplot007.png b/reference/Rplot007.png
index 48f4a5f3..48d122f8 100644
Binary files a/reference/Rplot007.png and b/reference/Rplot007.png differ
diff --git a/reference/Rplot008.png b/reference/Rplot008.png
index feb54c48..3cd3232a 100644
Binary files a/reference/Rplot008.png and b/reference/Rplot008.png differ
diff --git a/reference/Rplot009.png b/reference/Rplot009.png
index 25008cc5..042ffc54 100644
Binary files a/reference/Rplot009.png and b/reference/Rplot009.png differ
diff --git a/reference/WHOCC.html b/reference/WHOCC.html
index 9495926d..974bab2a 100644
--- a/reference/WHOCC.html
+++ b/reference/WHOCC.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/WHONET.html b/reference/WHONET.html
index b89c7d8b..652925aa 100644
--- a/reference/WHONET.html
+++ b/reference/WHONET.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/ab_from_text.html b/reference/ab_from_text.html
index 03a07557..78694d71 100644
--- a/reference/ab_from_text.html
+++ b/reference/ab_from_text.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/ab_property.html b/reference/ab_property.html
index f889ef7d..5e91f078 100644
--- a/reference/ab_property.html
+++ b/reference/ab_property.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/add_custom_antimicrobials.html b/reference/add_custom_antimicrobials.html
index ae8ca2dd..5034d06b 100644
--- a/reference/add_custom_antimicrobials.html
+++ b/reference/add_custom_antimicrobials.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/add_custom_microorganisms.html b/reference/add_custom_microorganisms.html
index 34de2fac..f6bf20fc 100644
--- a/reference/add_custom_microorganisms.html
+++ b/reference/add_custom_microorganisms.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/age.html b/reference/age.html
index 56aa3060..9c697f14 100644
--- a/reference/age.html
+++ b/reference/age.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -205,16 +205,16 @@
df
#> birth_date age age_exact age_at_y2k
-#> 1 1935-04-26 88 88.04384 64
-#> 2 1939-12-20 83 83.39178 60
-#> 3 1940-09-26 82 82.62466 59
-#> 4 1981-04-16 42 42.07123 18
-#> 5 1946-10-07 76 76.59452 53
-#> 6 1974-10-27 48 48.53973 25
-#> 7 1938-08-21 84 84.72329 61
-#> 8 1941-05-13 81 81.99726 58
-#> 9 1933-07-19 89 89.81370 66
-#> 10 1977-01-31 46 46.27671 22
+#> 1 1973-10-03 49 49.61918 26
+#> 2 1982-04-23 41 41.06575 17
+#> 3 1977-12-04 45 45.44932 22
+#> 4 1982-03-29 41 41.13425 17
+#> 5 1970-07-24 52 52.81370 29
+#> 6 1982-04-15 41 41.08767 17
+#> 7 1990-06-30 32 32.87945 9
+#> 8 1932-03-06 91 91.19726 67
+#> 9 1966-09-16 56 56.66575 33
+#> 10 1932-01-09 91 91.35068 67
On this page
diff --git a/reference/age_groups.html b/reference/age_groups.html
index f7e4486c..c2cddae0 100644
--- a/reference/age_groups.html
+++ b/reference/age_groups.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/antibiogram.html b/reference/antibiogram.html
index 83d591a4..1297e232 100644
--- a/reference/antibiogram.html
+++ b/reference/antibiogram.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/antibiotic_class_selectors.html b/reference/antibiotic_class_selectors.html
index be83351d..96708845 100644
--- a/reference/antibiotic_class_selectors.html
+++ b/reference/antibiotic_class_selectors.html
@@ -12,7 +12,7 @@ In short, if you have a column name that resembles an antimicrobial drug, it wil
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -609,8 +609,8 @@ In short, if you have a column name that resembles an antimicrobial drug, it wil
#> # A tibble: 5 × 1
#> kefzol
#> <sir>
-#> 1 I
-#> 2 R
+#> 1 S
+#> 2 I
#> 3 R
#> 4 I
#> 5 R
diff --git a/reference/antibiotics.html b/reference/antibiotics.html
index e1b7aba4..3b616779 100644
--- a/reference/antibiotics.html
+++ b/reference/antibiotics.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.ab.html b/reference/as.ab.html
index 3ec4a048..2b38e504 100644
--- a/reference/as.ab.html
+++ b/reference/as.ab.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.av.html b/reference/as.av.html
index acd8afe0..8e9a2bce 100644
--- a/reference/as.av.html
+++ b/reference/as.av.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.disk.html b/reference/as.disk.html
index 8bf9e1e2..c70bd55f 100644
--- a/reference/as.disk.html
+++ b/reference/as.disk.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.mic.html b/reference/as.mic.html
index 667d0c06..94e95cd4 100644
--- a/reference/as.mic.html
+++ b/reference/as.mic.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.mo.html b/reference/as.mo.html
index 60c324f6..8dd0fc4e 100644
--- a/reference/as.mo.html
+++ b/reference/as.mo.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/as.sir.html b/reference/as.sir.html
index 1f053c6b..6ea52a59 100644
--- a/reference/as.sir.html
+++ b/reference/as.sir.html
@@ -12,7 +12,7 @@ All breakpoints used for interpretation are publicly available in the clinical_b
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -534,16 +534,16 @@ A microorganism is categorised as "Resistant" when there is a high likelihood of
#> # A tibble: 50 × 12
#> datetime index ab_input ab_guideline mo_input mo_guideline
#> <dttm> <int> <chr> <ab> <chr> <mo>
-#> 1 2023-05-12 08:40:42 1 TOB TOB Escherichia… B_[ORD]_ENTRBCTR
-#> 2 2023-05-12 08:40:42 1 GEN GEN Escherichia… B_[ORD]_ENTRBCTR
-#> 3 2023-05-12 08:40:42 1 CIP CIP Escherichia… B_[ORD]_ENTRBCTR
-#> 4 2023-05-12 08:40:41 1 AMP AMP Escherichia… B_[ORD]_ENTRBCTR
-#> 5 2023-05-12 08:40:37 1 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
-#> 6 2023-05-12 08:40:37 2 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
-#> 7 2023-05-12 08:40:37 3 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
-#> 8 2023-05-12 08:40:37 4 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
-#> 9 2023-05-12 08:40:37 5 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
-#> 10 2023-05-12 08:40:37 6 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 1 2023-05-17 20:17:18 1 TOB TOB Escherichia… B_[ORD]_ENTRBCTR
+#> 2 2023-05-17 20:17:18 1 GEN GEN Escherichia… B_[ORD]_ENTRBCTR
+#> 3 2023-05-17 20:17:17 1 CIP CIP Escherichia… B_[ORD]_ENTRBCTR
+#> 4 2023-05-17 20:17:17 1 AMP AMP Escherichia… B_[ORD]_ENTRBCTR
+#> 5 2023-05-17 20:17:11 1 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 6 2023-05-17 20:17:11 2 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 7 2023-05-17 20:17:11 3 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 8 2023-05-17 20:17:11 4 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 9 2023-05-17 20:17:11 5 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
+#> 10 2023-05-17 20:17:11 6 CIP CIP B_ESCHR_COLI B_[ORD]_ENTRBCTR
#> # ℹ 40 more rows
#> # ℹ 6 more variables: guideline <chr>, ref_table <chr>, method <chr>,
#> # input <dbl>, outcome <sir>, breakpoint_S_R <chr>
diff --git a/reference/atc_online.html b/reference/atc_online.html
index 5f918d56..cae48296 100644
--- a/reference/atc_online.html
+++ b/reference/atc_online.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/av_from_text.html b/reference/av_from_text.html
index 9d35fa74..9a1de4fb 100644
--- a/reference/av_from_text.html
+++ b/reference/av_from_text.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/av_property.html b/reference/av_property.html
index 28f93cf1..3b18fc34 100644
--- a/reference/av_property.html
+++ b/reference/av_property.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/availability.html b/reference/availability.html
index b2dadb69..ce08c49a 100644
--- a/reference/availability.html
+++ b/reference/availability.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/bug_drug_combinations.html b/reference/bug_drug_combinations.html
index ebabe115..1b7e88fb 100644
--- a/reference/bug_drug_combinations.html
+++ b/reference/bug_drug_combinations.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/clinical_breakpoints.html b/reference/clinical_breakpoints.html
index e4ab9a65..283db4ca 100644
--- a/reference/clinical_breakpoints.html
+++ b/reference/clinical_breakpoints.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/count.html b/reference/count.html
index d732b501..6655cc77 100644
--- a/reference/count.html
+++ b/reference/count.html
@@ -12,7 +12,7 @@ count_resistant() should be used to count resistant isolates, count_susceptible(
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/custom_eucast_rules.html b/reference/custom_eucast_rules.html
index cc1c042a..4b09a216 100644
--- a/reference/custom_eucast_rules.html
+++ b/reference/custom_eucast_rules.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/dosage.html b/reference/dosage.html
index bc1fa264..9c6621d4 100644
--- a/reference/dosage.html
+++ b/reference/dosage.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/eucast_rules.html b/reference/eucast_rules.html
index 900bcab5..0799d27b 100644
--- a/reference/eucast_rules.html
+++ b/reference/eucast_rules.html
@@ -12,7 +12,7 @@ To improve the interpretation of the antibiogram before EUCAST rules are applied
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/example_isolates.html b/reference/example_isolates.html
index 6ad502e7..29b5e931 100644
--- a/reference/example_isolates.html
+++ b/reference/example_isolates.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/example_isolates_unclean.html b/reference/example_isolates_unclean.html
index c86b1ecd..117cfafc 100644
--- a/reference/example_isolates_unclean.html
+++ b/reference/example_isolates_unclean.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/first_isolate.html b/reference/first_isolate.html
index 5fbe150a..1275439c 100644
--- a/reference/first_isolate.html
+++ b/reference/first_isolate.html
@@ -12,7 +12,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -338,13 +338,12 @@
# See ?example_isolates.
example_isolates [ first_isolate ( info = TRUE ) , ]
-#> Determining first isolates using an episode length of 365 days
+#> ℹ Determining first isolates using an episode length of 365 days
#> ℹ Using column 'date' as input for col_date.
#> ℹ Using column 'patient' as input for col_patient_id.
-#> Basing inclusion on all antimicrobial results, using a points threshold of
-#> 2
-#> Including isolates from ICU.
-#> ℹ Excluded 16 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
+#> ℹ Basing inclusion on all antimicrobial results, using a points threshold
+#> of 2
+#> ℹ Excluding 16 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
#> => Found 1,379 'phenotype-based' first isolates (69.0% of total where a
#> microbial ID was available)
#> # A tibble: 1,379 × 46
@@ -397,11 +396,10 @@
example_isolates %>%
filter ( first_isolate ( info = TRUE ) )
}
-#> Determining first isolates using an episode length of 365 days
-#> Basing inclusion on all antimicrobial results, using a points threshold of
-#> 2
-#> Including isolates from ICU.
-#> ℹ Excluded 16 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
+#> ℹ Determining first isolates using an episode length of 365 days
+#> ℹ Basing inclusion on all antimicrobial results, using a points threshold
+#> of 2
+#> ℹ Excluding 16 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
#> => Found 1,379 'phenotype-based' first isolates (69.0% of total where a
#> microbial ID was available)
#> # A tibble: 1,379 × 46
@@ -456,25 +454,22 @@
mutate ( first = first_isolate ( info = TRUE ) ) %>%
select ( ward , date , patient , mo , first )
}
-#> Determining first isolates using an episode length of 365 days
-#> Basing inclusion on all antimicrobial results, using a points threshold of
-#> 2
-#> Including isolates from ICU.
+#> ℹ Determining first isolates using an episode length of 365 days
+#> ℹ Basing inclusion on all antimicrobial results, using a points threshold
+#> of 2
#>
#> Group: ward = "Clinical"
-#> ℹ Excluded 9 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
+#> ℹ Excluding 9 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
#> => Found 861 'phenotype-based' first isolates (69.8% of total where a
#> microbial ID was available)
-#> Including isolates from ICU.
#>
#> Group: ward = "ICU"
-#> ℹ Excluded 6 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
+#> ℹ Excluding 6 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
#> => Found 449 'phenotype-based' first isolates (69.6% within scope and 69.5%
#> of total where a microbial ID was available)
-#> Including isolates from ICU.
#>
#> Group: ward = "Outpatient"
-#> ℹ Excluded 1 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
+#> ℹ Excluding 1 isolates with a microbial ID 'UNKNOWN' (in column 'mo')
#> => Found 98 'phenotype-based' first isolates (82.4% within scope and 81.7%
#> of total where a microbial ID was available)
#> # A tibble: 2,000 × 5
diff --git a/reference/g.test.html b/reference/g.test.html
index 2d0d6e0d..476bdc34 100644
--- a/reference/g.test.html
+++ b/reference/g.test.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
diff --git a/reference/get_episode.html b/reference/get_episode.html
index 07dbe722..93b37640 100644
--- a/reference/get_episode.html
+++ b/reference/get_episode.html
@@ -10,7 +10,7 @@
AMR (for R)
- 2.0.0.9015
+ 2.0.0.9018
@@ -246,27 +246,27 @@
df <- example_isolates [ sample ( seq_len ( 2000 ) , size = 100 ) , ]
get_episode ( df $ date , episode_days = 60 ) # indices
-#> [1] 45 13 42 35 36 17 26 23 21 32 27 48 22 10 19 4 37 5 18 11 7 15 3 38 28
-#> [26] 47 51 35 6 41 16 25 24 26 4 38 24 35 2 26 10 44 43 1 46 19 12 15 49 41
-#> [51] 29 5 31 11 33 18 9 48 12 20 25 47 36 46 16 52 8 30 34 51 7 27 50 40 47
-#> [76] 39 34 35 15 32 27 10 26 36 26 11 34 44 37 50 48 14 22 2 45 5 26 30 51 5
+#> [1] 12 21 4 9 13 34 31 14 43 33 40 37 45 5 41 35 34 30 8 5 25 7 26 39 22
+#> [26] 30 17 36 5 42 9 17 4 13 17 24 43 5 16 16 19 8 10 14 38 13 14 35 23 9
+#> [51] 35 37 39 1 6 33 29 31 2 11 18 33 29 3 40 7 30 40 14 20 33 32 26 44 44
+#> [76] 43 13 14 6 40 14 10 21 27 42 39 7 7 32 18 25 8 14 28 38 35 9 24 15 5
is_new_episode ( df $ date , episode_days = 60 ) # TRUE/FALSE
#> [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
-#> [13] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
-#> [25] TRUE TRUE TRUE FALSE TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE
-#> [37] FALSE FALSE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE TRUE FALSE
-#> [49] TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE TRUE
-#> [61] FALSE FALSE FALSE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE FALSE
-#> [73] TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
-#> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE FALSE FALSE
-#> [97] FALSE FALSE FALSE FALSE
+#> [13] TRUE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE
+#> [25] TRUE FALSE TRUE TRUE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE
+#> [37] FALSE FALSE TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE FALSE FALSE
+#> [49] TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE TRUE TRUE
+#> [61] TRUE FALSE FALSE TRUE FALSE FALSE FALSE FALSE FALSE TRUE FALSE TRUE
+#> [73] FALSE TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE
+#> [85] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE TRUE FALSE FALSE
+#> [97] FALSE FALSE TRUE FALSE
# filter on results from the third 60-day episode only, using base R
df [ which ( get_episode ( df $ date , 60 ) == 3 ) , ]
#> # A tibble: 1 × 46
#> date patient age gender ward mo PEN OXA FLC AMX
#> <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
-#> 1 2002-07-21 955940 82 F Clinical B_PSDMN_AERG R NA NA R
+#> 1 2002-06-23 798871 82 M Clinical B_ENTRC_FCLS NA NA NA NA
#> # ℹ 36 more variables: AMC <sir>, AMP <sir>, TZP <sir>, CZO <sir>, FEP <sir>,
#> # CXM <sir>, FOX <sir>, CTX <sir>, CAZ <sir>, CRO <sir>, GEN <sir>,
#> # TOB <sir>, AMK <sir>, KAN <sir>, TMP <sir>, SXT <sir>, NIT <sir>,
@@ -300,19 +300,19 @@
arrange ( patient , condition , date )
}
#> # A tibble: 100 × 4
-#> # Groups: patient, condition [99]
+#> # Groups: patient, condition [94]
#> patient date condition new_episode
#> <chr> <date> <chr> <lgl>
-#> 1 023456 2009-11-02 A TRUE
-#> 2 036063 2010-01-28 B TRUE
-#> 3 0DBB93 2003-10-02 A TRUE
-#> 4 0DBF93 2015-10-12 B TRUE
-#> 5 0E2483 2007-06-21 A TRUE
-#> 6 114570 2003-04-08 B TRUE
-#> 7 14D826 2006-09-14 A TRUE
-#> 8 156730 2012-04-12 B TRUE
-#> 9 1710B8 2008-01-22 C TRUE
-#> 10 180928 2008-06-13 A TRUE
+#> 1 010257 2004-04-03 C TRUE
+#> 2 022060 2004-05-04 C TRUE
+#> 3 023456 2009-11-02 C TRUE
+#> 4 067927 2002-01-07 A TRUE
+#> 5 0E2483 2007-05-29 A FALSE
+#> 6 0E2483 2007-06-21 A TRUE
+#> 7 0E2483 2007-06-21 A FALSE
+#> 8 0E2483 2007-11-10 A FALSE
+#> 9 114570 2003-04-08 B TRUE
+#> 10 141061 2014-10-22 C TRUE
#> # ℹ 90 more rows
if ( require ( "dplyr" ) ) {
@@ -326,19 +326,19 @@
arrange ( patient , ward , date )
}
#> # A tibble: 100 × 5
-#> # Groups: ward, patient [94]
+#> # Groups: ward, patient [93]
#> ward date patient new_index new_logical
#> <chr> <date> <chr> <int> <lgl>
-#> 1 Clinical 2009-11-02 023456 1 TRUE
-#> 2 Clinical 2010-01-28 036063 1 TRUE
-#> 3 ICU 2003-10-02 0DBB93 1 TRUE
-#> 4 Clinical 2015-10-12 0DBF93 1 TRUE
-#> 5 ICU 2007-06-21 0E2483 1 TRUE
-#> 6 ICU 2003-04-08 114570 1 TRUE
-#> 7 Clinical 2006-09-14 14D826 1 TRUE
-#> 8 Clinical 2012-04-12 156730 1 TRUE
-#> 9 Clinical 2008-01-22 1710B8 1 TRUE
-#> 10 Clinical 2008-06-14 180928 1 FALSE
+#> 1 Clinical 2004-04-03 010257 1 TRUE
+#> 2 ICU 2004-05-04 022060 1 TRUE
+#> 3 Clinical 2009-11-02 023456 1 TRUE
+#> 4 ICU 2002-01-07 067927 1 TRUE
+#> 5 Clinical 2007-05-29 0E2483 1 TRUE
+#> 6 Clinical 2007-11-10 0E2483 2 TRUE
+#> 7 ICU 2007-06-21 0E2483 1 TRUE
+#> 8 ICU 2007-06-21 0E2483 1 FALSE
+#> 9 ICU 2003-04-08 114570 1 TRUE
+#> 10 Clinical 2014-10-22 141061 1 TRUE
#> # ℹ 90 more rows
if ( require ( "dplyr" ) ) {
@@ -354,9 +354,9 @@
#> # A tibble: 3 × 5
#> ward n_patients n_episodes_365 n_episodes_60 n_episodes_30
#> <chr> <int> <int> <int> <int>
-#> 1 Clinical 64 14 40 49
-#> 2 ICU 23 9 20 21
-#> 3 Outpatient 7 5 6 7
+#> 1 Clinical 53 13 35 42
+#> 2 ICU 34 10 24 29
+#> 3 Outpatient 6 4 6 6
# grouping on patients and microorganisms leads to the same
# results as first_isolate() when using 'episode-based':
@@ -385,19 +385,19 @@
select ( group_vars ( . ) , flag_episode )
}
#> # A tibble: 100 × 4
-#> # Groups: patient, mo, ward [98]
+#> # Groups: patient, mo, ward [95]
#> patient mo ward flag_episode
#> <chr> <mo> <chr> <lgl>
-#> 1 A76045 B_ENTRC_FACM ICU TRUE
-#> 2 452212 B_ENTRC_FACM ICU TRUE
-#> 3 419568 B_STRPT_PNMN Clinical TRUE
-#> 4 BC9909 B_ESCHR_COLI Clinical TRUE
-#> 5 443847 B_KLBSL_PNMN Clinical TRUE
-#> 6 F32657 B_STPHY_EPDR ICU TRUE
-#> 7 180928 B_STRPT_AGLC Clinical TRUE
-#> 8 B82692 B_STPHY_CONS Clinical TRUE
-#> 9 89F578 B_STPHY_CONS Clinical TRUE
-#> 10 597301 B_ESCHR_COLI ICU TRUE
+#> 1 964998 B_STRPT_PNMN Clinical TRUE
+#> 2 DF0749 B_ESCHR_COLI Clinical TRUE
+#> 3 496896 B_STPHY_CONS ICU TRUE
+#> 4 E48302 B_STRPT_PNMN ICU TRUE
+#> 5 E19440 B_ESCHR_COLI ICU TRUE
+#> 6 545388 B_STPHY_CPTS Clinical TRUE
+#> 7 824233 B_STPHY_AURS Clinical TRUE
+#> 8 54890C B_ESCHR_COLI Clinical TRUE
+#> 9 CD8C33 B_STPHY_HMNS Clinical TRUE
+#> 10 966513 B_STPHY_HMNS Clinical TRUE
#> # ℹ 90 more rows
# }