* Functions `as.bactid` and `is.bactid` to transform/look up microbial ID's; this replaces the function `guess_bactid` but it will remain available for backwards compatibility
* Functions `as.bactid` and `is.bactid` to transform/look up microbial ID's
* For convience, new descriptive statistical functions `kurtosis` and `skewness` that are lacking in base R - they are generic functions and have support for vectors, data.frames and matrices
* Function `g.test` to perform the Χ<sup>2</sup> distributed [*G*-test](https://en.wikipedia.org/wiki/G-test), which use is the same as `chisq.test`
* Function `ratio` to transform a vector of values to a preset ratio
#' Use this function to determine a valid ID based on a genus (and species). This input can be a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), or just a genus. You could also \code{\link{select}} a genus and species column, zie Examples.
#' @param x a character vector or a dataframe with one or two columns
#' @rdname as.bactid
#' @details Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. For example:
#' @details \code{guess_bactid} does exactly the same as \code{as.bactid}.
#'
#' Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. For example:
#' \itemize{
#' \item{\code{"E. coli"} will return the ID of \emph{Escherichia coli} and not \emph{Entamoeba coli}, although the latter would alphabetically come first}
#' \item{\code{"H. influenzae"} will return the ID of \emph{Haemophilus influenzae} and not \emph{Haematobacter influenzae}}
@ -53,17 +55,16 @@
@@ -53,17 +55,16 @@
#' library(dplyr)
#' df$bactid <- df %>%
#' select(microorganism_name) %>%
#' as.bactid()
#' guess_bactid()
#'
#' # and can even contain 2 columns, which is convenient for genus/species combinations:
@ -53,9 +53,9 @@ The functions to calculate microbial resistance use expressions that are not eva
@@ -53,9 +53,9 @@ The functions to calculate microbial resistance use expressions that are not eva
This package [is published on CRAN](http://cran.r-project.org/package=AMR), the official R network.
(Note: downloads measured only by [cran.rstudio.com](https://cran.rstudio.com/package=AMR), i.e. this excludes the official [cran.r-project.org](https://cran.r-project.org/package=AMR))
(Note: Downloads measured only by [cran.rstudio.com](https://cran.rstudio.com/package=AMR), this excludes e.g. the official [cran.r-project.org](https://cran.r-project.org/package=AMR))
- <imgsrc="http://www.rstudio.com/favicon.ico"alt="RStudio favicon"height="20px"> Install using [RStudio](http://www.rstudio.com) (recommended):
@ -22,6 +22,8 @@ Character (vector) with class \code{"bactid"}. Unknown values will return \code{
@@ -22,6 +22,8 @@ Character (vector) with class \code{"bactid"}. Unknown values will return \code{
Use this function to determine a valid ID based on a genus (and species). This input can be a full name (like \code{"Staphylococcus aureus"}), an abbreviated name (like \code{"S. aureus"}), or just a genus. You could also \code{\link{select}} a genus and species column, zie Examples.
}
\details{
\code{guess_bactid} does exactly the same as \code{as.bactid}.
Some exceptions have been built in to get more logical results, based on prevalence of human pathogens. For example:
\itemize{
\item{\code{"E. coli"} will return the ID of \emph{Escherichia coli} and not \emph{Entamoeba coli}, although the latter would alphabetically come first}