mirror of
				https://github.com/msberends/AMR.git
				synced 2025-10-31 06:08:14 +01:00 
			
		
		
		
	fixes
This commit is contained in:
		| @@ -67,7 +67,7 @@ The function \code{\link[=count_resistant]{count_resistant()}} is equal to the f | ||||
|  | ||||
| The function \code{\link[=n_sir]{n_sir()}} is an alias of \code{\link[=count_all]{count_all()}}. They can be used to count all available isolates, i.e. where all input antibiotics have an available result (S, I or R). Their use is equal to \code{n_distinct()}. Their function is equal to \code{count_susceptible(...) + count_resistant(...)}. | ||||
|  | ||||
| The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and counts the number of S's, I's and R's. It also supports grouped variables. The function \code{\link[=sir_sf]{sir_sf()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. | ||||
| The function \code{\link[=count_df]{count_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and counts the number of S's, I's and R's. It also supports grouped variables. The function \code{\link[=sir_df]{sir_df()}} works exactly like \code{\link[=count_df]{count_df()}}, but adds the percentage of S, I and R. | ||||
| } | ||||
| \section{Interpretation of SIR}{ | ||||
|  | ||||
|   | ||||
| @@ -120,7 +120,7 @@ Use these functions to create bar plots for AMR data analysis. All functions rel | ||||
| At default, the names of antibiotics will be shown on the plots using \code{\link[=ab_name]{ab_name()}}. This can be set with the \code{translate_ab} argument. See \code{\link[=count_df]{count_df()}}. | ||||
| \subsection{The Functions}{ | ||||
|  | ||||
| \code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_sf]{sir_sf()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. | ||||
| \code{\link[=geom_sir]{geom_sir()}} will take any variable from the data that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) using \code{\link[=sir_df]{sir_df()}} and will plot bars with the percentage S, I, and R. The default behaviour is to have the bars stacked and to have the different antibiotics on the x axis. | ||||
|  | ||||
| \code{\link[=facet_sir]{facet_sir()}} creates 2d plots (at default based on S/I/R) using \code{\link[ggplot2:facet_wrap]{ggplot2::facet_wrap()}}. | ||||
|  | ||||
|   | ||||
| @@ -12,7 +12,7 @@ | ||||
| \alias{proportion_SI} | ||||
| \alias{proportion_S} | ||||
| \alias{proportion_df} | ||||
| \alias{sir_sf} | ||||
| \alias{sir_df} | ||||
| \title{Calculate Microbial Resistance} | ||||
| \source{ | ||||
| \strong{M39 Analysis and Presentation of Cumulative Antimicrobial Susceptibility Test Data, 5th Edition}, 2022, \emph{Clinical and Laboratory Standards Institute (CLSI)}. \url{https://clsi.org/standards/products/microbiology/documents/m39/}. | ||||
| @@ -52,7 +52,7 @@ proportion_df( | ||||
|   confidence_level = 0.95 | ||||
| ) | ||||
|  | ||||
| sir_sf( | ||||
| sir_df( | ||||
|   data, | ||||
|   translate_ab = "name", | ||||
|   language = get_AMR_locale(), | ||||
| @@ -102,7 +102,7 @@ Use \code{\link[=sir_confidence_interval]{sir_confidence_interval()}} to calcula | ||||
|  | ||||
| These functions are not meant to count isolates, but to calculate the proportion of resistance/susceptibility. Use the \code{\link[=count]{count()}} functions to count isolates. The function \code{\link[=susceptibility]{susceptibility()}} is essentially equal to \code{count_susceptible() / count_all()}. \emph{Low counts can influence the outcome - the \code{proportion} functions may camouflage this, since they only return the proportion (albeit being dependent on the \code{minimum} argument).} | ||||
|  | ||||
| The function \code{\link[=proportion_df]{proportion_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and calculates the proportions S, I, and R. It also supports grouped variables. The function \code{\link[=sir_sf]{sir_sf()}} works exactly like \code{\link[=proportion_df]{proportion_df()}}, but adds the number of isolates. | ||||
| The function \code{\link[=proportion_df]{proportion_df()}} takes any variable from \code{data} that has an \code{\link{sir}} class (created with \code{\link[=as.sir]{as.sir()}}) and calculates the proportions S, I, and R. It also supports grouped variables. The function \code{\link[=sir_df]{sir_df()}} works exactly like \code{\link[=proportion_df]{proportion_df()}}, but adds the number of isolates. | ||||
| } | ||||
| \section{Combination Therapy}{ | ||||
|  | ||||
| @@ -270,11 +270,11 @@ if (require("dplyr")) { | ||||
|     proportion_df(translate = FALSE) | ||||
|  | ||||
|   # It also supports grouping variables | ||||
|   # (use sir_sf to also include the count) | ||||
|   # (use sir_df to also include the count) | ||||
|   example_isolates \%>\% | ||||
|     select(ward, AMX, CIP) \%>\% | ||||
|     group_by(ward) \%>\% | ||||
|     sir_sf(translate = FALSE) | ||||
|     sir_df(translate = FALSE) | ||||
| } | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user