1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-09 11:01:57 +02:00

adding mo fixes

This commit is contained in:
2023-01-14 19:50:25 +01:00
parent ca79068604
commit b94bc6c67b
12 changed files with 69 additions and 44 deletions

View File

@ -3,7 +3,7 @@
\name{add_custom_antimicrobials}
\alias{add_custom_antimicrobials}
\alias{clear_custom_antimicrobials}
\title{Add Custom Antimicrobials to This Package}
\title{Add Custom Antimicrobials}
\usage{
add_custom_antimicrobials(x)
@ -13,7 +13,7 @@ clear_custom_antimicrobials()
\item{x}{a \link{data.frame} resembling the \link{antibiotics} data set, at least containing columns "ab" and "name"}
}
\description{
With \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} you can add your own custom antimicrobial drug codes to the \code{AMR} package.
With \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} you can add your own custom antimicrobial drug names and codes.
}
\details{
\strong{Important:} Due to how \R works, the \code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} function has to be run in every \R session - added antimicrobials are not stored between sessions and are thus lost when \R is exited.
@ -52,7 +52,7 @@ Use \code{\link[=clear_custom_antimicrobials]{clear_custom_antimicrobials()}} to
\examples{
\donttest{
# returns NA and throws a warning (which is now suppressed):
# returns NA and throws a warning (which is suppressed here):
suppressWarnings(
as.ab("testab")
)
@ -101,5 +101,5 @@ x[, betalactams()]
}
}
\seealso{
\code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}} to add custom microorganisms to this package.
\code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}} to add custom microorganisms.
}

View File

@ -3,7 +3,7 @@
\name{add_custom_microorganisms}
\alias{add_custom_microorganisms}
\alias{clear_custom_microorganisms}
\title{Add Custom Microorganisms to This Package}
\title{Add Custom Microorganisms}
\usage{
add_custom_microorganisms(x)
@ -13,7 +13,7 @@ clear_custom_microorganisms()
\item{x}{a \link{data.frame} resembling the \link{microorganisms} data set, at least containing column "genus" (case-insensitive)}
}
\description{
With \code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}} you can add your own custom microorganisms to the \code{AMR} package, such the non-taxonomic outcome of laboratory analysis.
With \code{\link[=add_custom_microorganisms]{add_custom_microorganisms()}} you can add your own custom microorganisms, such the non-taxonomic outcome of laboratory analysis.
}
\details{
This function will fill in missing taxonomy for you, if specific taxonomic columns are missing, see \emph{Examples}.
@ -83,17 +83,25 @@ mo_info("Enterobacter asburiae/cloacae")
# the function tries to be forgiving:
add_custom_microorganisms(
data.frame(GENUS = "ESCHERICHIA / KLEBSIELLA",
SPECIES = "SPECIES"))
data.frame(GENUS = "ESCHERICHIA / KLEBSIELLA SLASHLINE",
SPECIES = "SPECIES")
)
mo_name("ESCHERICHIA / KLEBSIELLA")
mo_rank("ESCHERICHIA / KLEBSIELLA")
# taxonomy still works, although a slashline genus was given as input:
mo_family("Escherichia/Klebsiella")
# for groups and complexes, set them as species or subspecies:
add_custom_microorganisms(
data.frame(genus = "Citrobacter", species = "freundii complex"))
mo_name("C. freundii complex")
mo_gramstain("C. freundii complex")
data.frame(genus = "Citrobacter",
species = c("freundii", "braakii complex"),
subspecies = c("complex", ""))
)
mo_name(c("C. freundii complex", "C. braakii complex"))
mo_species(c("C. freundii complex", "C. braakii complex"))
mo_gramstain(c("C. freundii complex", "C. braakii complex"))
}
}
\seealso{
\code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} to add custom antimicrobials to this package.
\code{\link[=add_custom_antimicrobials]{add_custom_antimicrobials()}} to add custom antimicrobials.
}