AMR/man/availability.Rd

43 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-02-04 12:24:07 +01:00
% 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{
2019-03-26 15:34:04 +01:00
availability(tbl, width = NULL)
2019-02-04 12:24:07 +01:00
}
\arguments{
\item{tbl}{a \code{data.frame} or \code{list}}
2019-03-26 15:34:04 +01:00
\item{width}{number of characters to present the visual availability, defaults to filling the width of the console}
2019-02-04 12:24:07 +01:00
}
\value{
2019-03-26 15:34:04 +01:00
\code{data.frame} with column names of \code{tbl} as row names
2019-02-04 12:24:07 +01:00
}
\description{
2019-08-25 22:53:22 +02:00
Easy check for availability of columns in a data set. This makes it easy to get an idea of which antimicrobial combination can be used for calculation with e.g. \code{\link{portion_R}}.
}
\details{
The function returns a \code{data.frame} with columns \code{"resistant"} and \code{"visual_resistance"}. The values in that columns are calculated with \code{\link{portion_R}}.
2019-02-04 12:24:07 +01:00
}
2019-02-21 18:55:52 +01:00
\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 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}.
2019-02-21 18:55:52 +01:00
}
2019-02-04 12:24:07 +01:00
\examples{
availability(example_isolates)
2019-02-04 12:24:07 +01:00
library(dplyr)
example_isolates \%>\% availability()
2019-02-04 12:24:07 +01:00
example_isolates \%>\%
2019-02-04 12:24:07 +01:00
select_if(is.rsi) \%>\%
availability()
example_isolates \%>\%
2019-02-04 12:24:07 +01:00
filter(mo == as.mo("E. coli")) \%>\%
select_if(is.rsi) \%>\%
availability()
}