stop_("function ",name,"() not found in package '",pkg,"'. Please contact the maintainers of the AMR package at https://github.com/msberends/AMR/issues.",call=FALSE)
stop_("function ",name,"() not found in package '",pkg,
"'. Please create an issue at https://github.com/msberends/AMR/issues. Many thanks!",
#' Use these selection helpers inside any function that allows [Tidyverse selections](https://tidyselect.r-lib.org/reference/language.html), like `dplyr::select()` or `tidyr::pivot_longer()`. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
#' Use these selection helpers inside any function that allows [Tidyverse selection helpers](https://tidyselect.r-lib.org/reference/language.html), like `dplyr::select()` or `tidyr::pivot_longer()`. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
#' @inheritParams filter_ab_class
#' @details All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a selector like e.g. [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
#' @details All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the [antibiotics] data set. This means that a selector like e.g. [aminoglycosides()] will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
#'
#' These functions only work if the `tidyselect` package is installed, that comes with the `dplyr` package. An error will be thrown if `tidyselect` package is not installed, or if the functions are used outside a function that allows Tidyverse selections like `select()` or `pivot_longer()`.
#' **N.B. These functions only work if the `tidyselect` package is installed**, that comes with the `dplyr` package. An error will be thrown if the `tidyselect` package is not installed, or if the functions are used outside a function that allows Tidyverse selections like `select()` or `pivot_longer()`.
#' @rdname antibiotic_class_selectors
#' @seealso [filter_ab_class()] for the `filter()` equivalent.
#' @name antibiotic_class_selectors
#' @export
#' @inheritSection AMR Reference data publicly available
#' @inheritSection AMR Read more on our website!
#' @examples
#' \dontrun{
@ -58,7 +59,7 @@
#'
#' data.frame(irrelevant = "value",
#' J01CA01 = "S") %>% # ATC code of ampicillin
#' select(penicillins()) # so the 'J01CA01' column is selected
#' select(penicillins()) # the 'J01CA01' column will be selected
<li><p>Speed improvement for <code><ahref="../reference/eucast_rules.html">eucast_rules()</a></code></p></li>
<li><p>Overall speed improvement by tweaking joining functions</p></li>
<li><p>Function <code><ahref="../reference/mo_property.html">mo_shortname()</a></code> now return the genus for input where the species is unknown</p></li>
<li><p>BORSA is now recognised as an abbreviation for a <em>Staphylococcus aureus</em>, meaning that e.g.<code><ahref="../reference/mo_property.html">mo_genus("BORSA")</a></code> will return “Staphylococcus”</p></li>
<li><p>Support for coloured <code>tibble</code> printing of classes <code>mo</code>, <code>rsi</code>, <code>mic</code> and <code>disk</code></p></li>
<li><p>Function <code><ahref="../reference/mo_property.html">mo_shortname()</a></code> now returns the genus for input where the species is unknown</p></li>
<li><p>BORSA is now recognised as an abbreviation for <em>Staphylococcus aureus</em>, meaning that e.g.<code><ahref="../reference/mo_property.html">mo_genus("BORSA")</a></code> will return “Staphylococcus”</p></li>
<li><p>Support for coloured <code>tibble</code> printing of classes <code>ab</code>, <code>mo</code>, <code>rsi</code>, <code>mic</code> and <code>disk</code></p></li>
<metaproperty="og:title"content="Antibiotic class selectors — antibiotic_class_selectors"/>
<metaproperty="og:description"content="Use these selection helpers inside any function that allows Tidyverse selections, like dplyr::select() or tidyr::pivot_longer(). They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations." />
<metaproperty="og:description"content="Use these selection helpers inside any function that allows Tidyverse selection helpers, like dplyr::select() or tidyr::pivot_longer(). They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations." />
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.3.0.9007</span>
<spanclass="version label label-default"data-toggle="tooltip"data-placement="bottom"title="Latest development version">1.3.0.9009</span>
</span>
</div>
@ -239,7 +239,7 @@
</div>
<divclass="ref-description">
<p>Use these selection helpers inside any function that allows <ahref='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selections</a>, like <code><ahref='https://dplyr.tidyverse.org/reference/select.html'>dplyr::select()</a></code> or <code><ahref='https://tidyr.tidyverse.org/reference/pivot_longer.html'>tidyr::pivot_longer()</a></code>. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.</p>
<p>Use these selection helpers inside any function that allows <ahref='https://tidyselect.r-lib.org/reference/language.html'>Tidyverse selection helpers</a>, like <code><ahref='https://dplyr.tidyverse.org/reference/select.html'>dplyr::select()</a></code> or <code><ahref='https://tidyr.tidyverse.org/reference/pivot_longer.html'>tidyr::pivot_longer()</a></code>. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.</p>
<p>All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a selector like e.g. <code>aminoglycosides()</code> will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.</p>
<p>These functions only work if the <code>tidyselect</code> package is installed, that comes with the <code>dplyr</code> package. An error will be thrown if <code>tidyselect</code> package is not installed, or if the functions are used outside a function that allows Tidyverse selections like <code><ahref='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code> or <code>pivot_longer()</code>.</p>
<p>All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the <ahref='antibiotics.html'>antibiotics</a> data set. This means that a selector like e.g. <code>aminoglycosides()</code> will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.</p>
<p><strong>N.B. These functions only work if the <code>tidyselect</code> package is installed</strong>, that comes with the <code>dplyr</code> package. An error will be thrown if the <code>tidyselect</code> package is not installed, or if the functions are used outside a function that allows Tidyverse selections like <code><ahref='https://dplyr.tidyverse.org/reference/select.html'>select()</a></code> or <code>pivot_longer()</code>.</p>
<h2class="hasAnchor"id="reference-data-publicly-available"><aclass="anchor"href="#reference-data-publicly-available"></a>Reference data publicly available</h2>
<p>All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this <code>AMR</code> package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find <ahref='https://msberends.github.io/AMR/articles/datasets.html'>all download links on our website</a>, which is automatically updated with every code change.</p>
<h2class="hasAnchor"id="read-more-on-our-website-"><aclass="anchor"href="#read-more-on-our-website-"></a>Read more on our website!</h2>
J01CA01 = <spanclass='st'>"S"</span>) <spanclass='op'>%>%</span><spanclass='co'># ATC code of ampicillin</span>
<spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<spanclass='fu'>penicillins</span>()) <spanclass='co'># so the 'J01CA01' column is selected</span>
<spanclass='fu'><ahref='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<spanclass='fu'>penicillins</span>()) <spanclass='co'># the 'J01CA01' column will be selected</span>
FUN = <spanclass='fu'>function</span>(<spanclass='kw'>x</span>) <spanclass='fu'><ahref='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span>(<spanclass='kw'>x</span><spanclass='op'>==</span><spanclass='st'>"B_ESCHR_COLI"</span>,
FUN = <spanclass='fu'>function</span>(<spanclass='kw'>x</span>) <spanclass='fu'><ahref='https://rdrr.io/r/base/ifelse.html'>ifelse</a></span>(<spanclass='kw'>x</span><spanclass='op'>==</span><spanclass='fu'><ahref='as.mo.html'>as.mo</a></span>(<spanclass='st'>"E. coli"</span>),
\item{ab_class}{an antimicrobial class, like \code{"carbapenems"}. The columns \code{group}, \code{atc_group1} and \code{atc_group2} of the \link{antibiotics} data set will be searched (case-insensitive) for this value.}
}
\description{
Use these selection helpers inside any function that allows \href{https://tidyselect.r-lib.org/reference/language.html}{Tidyverse selections}, like \code{dplyr::select()} or \code{tidyr::pivot_longer()}. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
Use these selection helpers inside any function that allows \href{https://tidyselect.r-lib.org/reference/language.html}{Tidyverse selection helpers}, like \code{dplyr::select()} or \code{tidyr::pivot_longer()}. They help to select the columns of antibiotics that are of a specific antibiotic class, without the need to define the columns or antibiotic abbreviations.
}
\details{
All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.). This means that a selector like e.g. \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
All columns will be searched for known antibiotic names, abbreviations, brand names and codes (ATC, EARS-Net, WHO, etc.) in the \link{antibiotics} data set. This means that a selector like e.g. \code{\link[=aminoglycosides]{aminoglycosides()}} will pick up column names like 'gen', 'genta', 'J01GB03', 'tobra', 'Tobracin', etc.
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()}.
\strong{N.B. These functions only work if the \code{tidyselect} package is installed}, that comes with the \code{dplyr} package. An error will be thrown if the \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()}.
}
\section{Reference data publicly available}{
All reference data sets (about microorganisms, antibiotics, R/SI interpretation, EUCAST rules, etc.) in this \code{AMR} package are publicly and freely available. We continually export our data sets to formats for use in R, SPSS, SAS, Stata and Excel. We also supply flat files that are machine-readable and suitable for input in any software program, such as laboratory information systems. Please find \href{https://msberends.github.io/AMR/articles/datasets.html}{all download links on our website}, which is automatically updated with every code change.
}
\section{Read more on our website!}{
On our website \url{https://msberends.github.io/AMR} you can find \href{https://msberends.github.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.github.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.github.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}. As we would like to better understand the backgrounds and needs of our users, please \href{https://msberends.github.io/AMR/survey.html}{participate in our survey}!
@ -89,7 +94,7 @@ On our website \url{https://msberends.github.io/AMR} you can find \href{https://
data.frame(irrelevant = "value",
J01CA01 = "S") \%>\% # ATC code of ampicillin
select(penicillins()) # so the 'J01CA01' column is selected
select(penicillins()) # the 'J01CA01' column will be selected