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

limits for scale_y_percent - Licence update

This commit is contained in:
2018-12-16 22:45:12 +01:00
parent 1ed0cc9bfd
commit b937662a97
67 changed files with 733 additions and 150 deletions

View File

@ -7,7 +7,7 @@
Welcome to the \code{AMR} package. This page gives some additional contact information about the authors.
}
\details{
This package was intended to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and work with antibiotic properties by using evidence-based methods.
This package was intended to simplify the analysis and prediction of Antimicrobial Resistance (AMR) and ti work with antibiotic properties by using evidence-based methods.
This package was created for academic research by PhD students of the Faculty of Medical Sciences of the University of Groningen and the Medical Microbiology & Infection Prevention (MMBI) department of the University Medical Center Groningen (UMCG).
}

View File

@ -2,7 +2,7 @@
% Please edit documentation in R/age.R
\name{age_groups}
\alias{age_groups}
\title{Split ages in age groups}
\title{Split ages into age groups}
\usage{
age_groups(x, split_at = c(12, 25, 55, 75))
}
@ -25,31 +25,33 @@ To split ages, the input can be:
\item{A character:}
\itemize{
\item{\code{"children"}, equivalent of: \code{c(0, 1, 2, 4, 6, 13, 18)}. This will split on 0, 1, 2-3, 4-5, 6-12, 13-17 and 18+.}
\item{\code{"elderly"} or \code{"seniors"}, equivalent: of \code{c(65, 75, 85, 95)}. This will split on 0-64, 65-74, 75-84, 85-94 and 95+.}
\item{\code{"fives"}, equivalent: of \code{1:20 * 5}. This will split on 0-4, 5-9, 10-14, 15-19 and so forth.}
\item{\code{"tens"}, equivalent: of \code{1:10 * 10}. This will split on 0-9, 10-19, 20-29 and so forth.}
\item{\code{"elderly"} or \code{"seniors"}, equivalent of: \code{c(65, 75, 85, 95)}. This will split on 0-64, 65-74, 75-84, 85-94 and 95+.}
\item{\code{"fives"}, equivalent of: \code{1:20 * 5}. This will split on 0-4, 5-9, 10-14, 15-19 and so forth.}
\item{\code{"tens"}, equivalent of: \code{1:10 * 10}. This will split on 0-9, 10-19, 20-29 and so forth.}
}
}
}
\examples{
ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21)
# split on 0-49 and 50+
# split into 0-49 and 50+
age_groups(ages, 50)
# split on 0-20, 21-49 and 50+
age_groups(ages, c(21, 50))
# split into 0-19, 20-49 and 50+
age_groups(ages, c(20, 50))
# split on every ten years
# split into groups of ten years
age_groups(ages, 1:10 * 10)
age_groups(ages, "tens")
age_groups(ages, split_at = "tens")
# split on every five years
# split into groups of five years
age_groups(ages, 1:20 * 5)
age_groups(ages, "fives")
age_groups(ages, split_at = "fives")
# split on children
# split specifically for children
age_groups(ages, "children")
# same:
age_groups(ages, c(1, 2, 4, 6, 13, 17))
# resistance of ciprofloxacine per age group
library(dplyr)
@ -65,3 +67,5 @@ septic_patients \%>\%
\seealso{
age
}
\keyword{age}
\keyword{age_group}

View File

@ -12,8 +12,8 @@
\usage{
ggplot_rsi(data, position = NULL, x = "Antibiotic",
fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1),
translate_ab = "official", fun = count_df, nrow = NULL,
datalabels = TRUE, datalabels.size = 3,
limits = NULL, translate_ab = "official", fun = count_df,
nrow = NULL, datalabels = TRUE, datalabels.size = 3,
datalabels.colour = "grey15", ...)
geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"),
@ -22,7 +22,7 @@ geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"),
facet_rsi(facet = c("Interpretation", "Antibiotic"), nrow = NULL)
scale_y_percent(breaks = seq(0, 1, 0.1))
scale_y_percent(breaks = seq(0, 1, 0.1), limits = NULL)
scale_rsi_colours()
@ -44,6 +44,8 @@ labels_rsi_count(position = NULL, x = "Antibiotic",
\item{breaks}{numeric vector of positions}
\item{limits}{numeric vector of length two providing limits of the scale, use \code{NA} to refer to the existing minimum or maximum}
\item{translate_ab}{a column name of the \code{\link{antibiotics}} data set to translate the antibiotic abbreviations into, using \code{\link{abname}}. Default behaviour is to translate to official names according to the WHO. Use \code{translate_ab = FALSE} to disable translation.}
\item{fun}{function to transform \code{data}, either \code{\link{count_df}} (default) or \code{\link{portion_df}}}

View File

@ -117,7 +117,7 @@ read.4D(file, info = interactive(), header = TRUE, row.names = NULL,
}
}
\description{
This function is only useful for the MMB department of the UMCG. Use this function to \strong{import data by just defining the \code{file} parameter}. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the \code{mo} with \code{\link{as.mo}} and transform all antimicrobial columns with \code{\link{as.rsi}}.
This function is only useful for the MMB department of the UMCG. Use this function to \strong{import data by just defining the \code{file} parameter}. It will automatically transform birth dates and calculate patients age, translate the column names to English, transform the MO codes with \code{\link{as.mo}} and transform all antimicrobial columns with \code{\link{as.rsi}}.
}
\details{
Column names will be transformed, but the original column names are set as a "label" attribute and can be seen in e.g. RStudio Viewer.