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

(v1.3.0) skip more CRAN tests

This commit is contained in:
2020-07-31 10:50:08 +02:00
parent c8edcb7439
commit c5f7294381
45 changed files with 66 additions and 65 deletions

View File

@ -80,7 +80,7 @@ ab_from_text("500 mg amoxi po and 400mg cipro iv", collapse = ", ")
abx <- ab_from_text("500 mg amoxi po and 400mg cipro iv")
ab_group(abx[[1]])
if (require(dplyr)) {
if (require("dplyr")) {
tibble(clinical_text = c("given 400mg cipro and 500 mg amox",
"started on doxy iv today")) \%>\%
mutate(abx_codes = ab_from_text(clinical_text),

View File

@ -58,7 +58,8 @@ All columns will be searched for known antibiotic names, abbreviations, brand na
These functions only work if the \code{tidyselect} package is installed, that comes with the \code{dplyr} package. An error will be thrown if \code{tidyselect} package is not installed, or if the functions are used outside a function that allows Tidyverse selections like \code{select()} or \code{pivot_longer()}.
}
\examples{
if (require("dplyr")) {
\dontrun{
library(dplyr)
# this will select columns 'IPM' (imipenem) and 'MEM' (meropenem):
example_isolates \%>\%

View File

@ -71,7 +71,8 @@ If the unlying code needs breaking changes, they will occur gradually. For examp
}
\examples{
if (require(dplyr)) {
\dontrun{
library(dplyr)
# filter on isolates that have any result for any aminoglycoside
example_isolates \%>\% filter_ab_class("aminoglycoside")
@ -100,9 +101,7 @@ example_isolates \%>\%
example_isolates \%>\%
filter_aminoglycosides("R", "all") \%>\%
filter_fluoroquinolones("R", "all")
}
\dontrun{
# with dplyr 1.0.0 and higher (that adds 'across()'), this is equal:
example_isolates \%>\% filter_carbapenems("R", "all")
example_isolates \%>\% filter(across(carbapenems(), ~. == "R"))

View File

@ -118,7 +118,8 @@ The \link[=lifecycle]{lifecycle} of this function is \strong{maturing}. The unly
# See ?example_isolates.
# See ?pca for more info about Principal Component Analysis (PCA).
if (require("dplyr")) {
\dontrun{
library(dplyr)
pca_model <- example_isolates \%>\%
filter(mo_genus(mo) == "Staphylococcus") \%>\%
group_by(species = mo_shortname(mo)) \%>\%

View File

@ -150,7 +150,9 @@ if (require("dplyr")) {
}
# create nice plots with ggplot2 yourself
if (require(ggplot2) & require("dplyr")) {
\dontrun{
library(dplyr)
library(ggplot2)
data <- example_isolates \%>\%
filter(mo == as.mo("E. coli")) \%>\%