2018-03-19 12:43:22 +01:00
% Generated by roxygen2: do not edit by hand
2018-06-08 12:06:54 +02:00
% Please edit documentation in R/guess_bactid.R
2018-03-19 12:43:22 +01:00
\name{guess_bactid}
\alias{guess_bactid}
\title{Find bacteria ID based on genus/species}
\usage{
guess_bactid(x)
}
\arguments{
2018-06-08 12:06:54 +02:00
\item{x}{character vector or a dataframe with one or two columns}
2018-03-19 12:43:22 +01:00
}
\value{
Character (vector).
}
\description{
2018-06-08 12:06:54 +02:00
Use this function to determine a valid ID based on a genus (and species). This input could 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.
2018-03-19 12:43:22 +01:00
}
\examples{
# These examples all return "STAAUR", the ID of S. aureus:
guess_bactid("stau")
guess_bactid("STAU")
guess_bactid("staaur")
guess_bactid("S. aureus")
guess_bactid("S aureus")
guess_bactid("Staphylococcus aureus")
guess_bactid("MRSA") # Methicillin-resistant S. aureus
guess_bactid("VISA") # Vancomycin Intermediate S. aureus
2018-06-08 12:06:54 +02:00
\dontrun{
df$bactid <- guess_bactid(df$microorganism_name)
# the select function of tidyverse is also supported:
df$bactid <- df \%>\% select(microorganism_name) \%>\% guess_bactid()
# and can even contain 2 columns, which is convenient for genus/species combinations:
df$bactid <- df \%>\% select(genus, species) \%>\% guess_bactid()
# same result:
df <- df \%>\% mutate(bactid = paste(genus, species) \%>\% guess_bactid())
}
2018-03-19 12:43:22 +01:00
}
\seealso{
2018-03-23 14:46:02 +01:00
\code{\link{microorganisms}} for the dataframe that is being used to determine ID's.
2018-03-19 12:43:22 +01:00
}