mirror of https://github.com/msberends/AMR.git
51 lines
2.4 KiB
R
51 lines
2.4 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/availability.R
|
|
\name{availability}
|
|
\alias{availability}
|
|
\title{Check availability of columns}
|
|
\usage{
|
|
availability(tbl, width = NULL)
|
|
}
|
|
\arguments{
|
|
\item{tbl}{a \code{\link{data.frame}} or \code{\link{list}}}
|
|
|
|
\item{width}{number of characters to present the visual availability, defaults to filling the width of the console}
|
|
}
|
|
\value{
|
|
\code{\link{data.frame}} with column names of \code{tbl} as row names
|
|
}
|
|
\description{
|
|
Easy check for data availability of all columns in a data set. This makes it easy to get an idea of which antimicrobial combinations can be used for calculation with e.g. \code{\link[=susceptibility]{susceptibility()}} and \code{\link[=resistance]{resistance()}}.
|
|
}
|
|
\details{
|
|
The function returns a \code{\link{data.frame}} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link[=resistance]{resistance()}}.
|
|
}
|
|
\section{Stable lifecycle}{
|
|
|
|
\if{html}{\figure{lifecycle_stable.svg}{options: style=margin-bottom:5px} \cr}
|
|
The \link[AMR:lifecycle]{lifecycle} of this function is \strong{stable}. In a stable function, we are largely happy with the unlying code, and major changes are unlikely. This means that the unlying code will generally evolve by adding new arguments; we will avoid removing arguments or changing the meaning of existing arguments.
|
|
|
|
If the unlying code needs breaking changes, they will occur gradually. To begin with, the function or argument will be deprecated; it will continue to work but will emit an message informing you of the change. Next, typically after at least one newly released version on CRAN, the message will be transformed to an error.
|
|
}
|
|
|
|
\section{Read more on our website!}{
|
|
|
|
On our website \url{https://msberends.gitlab.io/AMR} you can find \href{https://msberends.gitlab.io/AMR/articles/AMR.html}{a comprehensive tutorial} about how to conduct AMR analysis, the \href{https://msberends.gitlab.io/AMR/reference}{complete documentation of all functions} (which reads a lot easier than here in R) and \href{https://msberends.gitlab.io/AMR/articles/WHONET.html}{an example analysis using WHONET data}.
|
|
}
|
|
|
|
\examples{
|
|
availability(example_isolates)
|
|
|
|
library(dplyr)
|
|
example_isolates \%>\% availability()
|
|
|
|
example_isolates \%>\%
|
|
select_if(is.rsi) \%>\%
|
|
availability()
|
|
|
|
example_isolates \%>\%
|
|
filter(mo == as.mo("E. coli")) \%>\%
|
|
select_if(is.rsi) \%>\%
|
|
availability()
|
|
}
|