1
0
mirror of https://github.com/msberends/AMR.git synced 2025-01-13 13:31:37 +01:00

(v0.6.1.9043) age doc fix

This commit is contained in:
dr. M.S. (Matthijs) Berends 2019-05-30 08:51:38 +02:00
parent 8b5e2b030b
commit 1f8ee3ec3e
14 changed files with 50 additions and 51 deletions

View File

@ -1,6 +1,6 @@
Package: AMR Package: AMR
Version: 0.6.1.9042 Version: 0.6.1.9043
Date: 2019-05-29 Date: 2019-05-30
Title: Antimicrobial Resistance Analysis Title: Antimicrobial Resistance Analysis
Authors@R: c( Authors@R: c(
person( person(

View File

@ -107,7 +107,7 @@ age <- function(x, reference = Sys.Date()) {
#' # resistance of ciprofloxacine per age group #' # resistance of ciprofloxacine per age group
#' library(dplyr) #' library(dplyr)
#' septic_patients %>% #' septic_patients %>%
#' filter_first_isolate) %>% #' filter_first_isolate() %>%
#' filter(mo == as.mo("E. coli")) %>% #' filter(mo == as.mo("E. coli")) %>%
#' group_by(age_group = age_groups(age)) %>% #' group_by(age_group = age_groups(age)) %>%
#' select(age_group, CIP) %>% #' select(age_group, CIP) %>%

View File

@ -162,9 +162,9 @@ ggplot_rsi <- function(data,
language = get_locale(), language = get_locale(),
fun = count_df, fun = count_df,
nrow = NULL, nrow = NULL,
datalabels = TRUE, datalabels = FALSE,
datalabels.size = 3, datalabels.size = 3,
datalabels.colour = "grey15", datalabels.colour = "white",
...) { ...) {
stopifnot_installed_package("ggplot2") stopifnot_installed_package("ggplot2")
@ -209,7 +209,7 @@ ggplot_rsi <- function(data,
position <- "fill" position <- "fill"
} }
if (fun_name == "portion_df" if (fun_name == "portion_df"
| (fun_name == "count_df" & position == "fill")) { | (fun_name == "count_df" & identical(position, "fill"))) {
# portions, so use y scale with percentage # portions, so use y scale with percentage
p <- p + scale_y_percent(breaks = breaks, limits = limits) p <- p + scale_y_percent(breaks = breaks, limits = limits)
} }
@ -361,13 +361,13 @@ theme_rsi <- function() {
labels_rsi_count <- function(position = NULL, labels_rsi_count <- function(position = NULL,
x = "Antibiotic", x = "Antibiotic",
datalabels.size = 3, datalabels.size = 3,
datalabels.colour = "grey15") { datalabels.colour = "white") {
stopifnot_installed_package("ggplot2") stopifnot_installed_package("ggplot2")
if (is.null(position)) { if (is.null(position)) {
position <- "fill" position <- "fill"
} }
if (position == "fill") { if (identical(position, "fill")) {
position <- ggplot2::position_fill(vjust = 0.5) position <- ggplot2::position_fill(vjust = 0.5, reverse = TRUE)
} }
ggplot2::geom_text(mapping = ggplot2::aes_string(label = "lbl", ggplot2::geom_text(mapping = ggplot2::aes_string(label = "lbl",
x = x, x = x,

View File

@ -78,7 +78,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -78,7 +78,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -78,7 +78,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -42,7 +42,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">AMR (for R)</a> <a class="navbar-link" href="index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -78,7 +78,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -80,7 +80,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>
@ -291,38 +291,37 @@
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2> <h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"># NOT RUN { <pre class="examples"><span class='co'># NOT RUN {</span>
ages <- c(3, 8, 16, 54, 31, 76, 101, 43, 21) <span class='no'>ages</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>3</span>, <span class='fl'>8</span>, <span class='fl'>16</span>, <span class='fl'>54</span>, <span class='fl'>31</span>, <span class='fl'>76</span>, <span class='fl'>101</span>, <span class='fl'>43</span>, <span class='fl'>21</span>)
# split into 0-49 and 50+ <span class='co'># split into 0-49 and 50+</span>
age_groups(ages, 50) <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='fl'>50</span>)
# split into 0-19, 20-49 and 50+ <span class='co'># split into 0-19, 20-49 and 50+</span>
age_groups(ages, c(20, 50)) <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>20</span>, <span class='fl'>50</span>))
# split into groups of ten years <span class='co'># split into groups of ten years</span>
age_groups(ages, 1:10 * 10) <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='fl'>1</span>:<span class='fl'>10</span> * <span class='fl'>10</span>)
age_groups(ages, split_at = "tens") <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='kw'>split_at</span> <span class='kw'>=</span> <span class='st'>"tens"</span>)
# split into groups of five years <span class='co'># split into groups of five years</span>
age_groups(ages, 1:20 * 5) <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='fl'>1</span>:<span class='fl'>20</span> * <span class='fl'>5</span>)
age_groups(ages, split_at = "fives") <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='kw'>split_at</span> <span class='kw'>=</span> <span class='st'>"fives"</span>)
# split specifically for children <span class='co'># split specifically for children</span>
age_groups(ages, "children") <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='st'>"children"</span>)
# same: <span class='co'># same:</span>
age_groups(ages, c(1, 2, 4, 6, 13, 17)) <span class='fu'>age_groups</span>(<span class='no'>ages</span>, <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>1</span>, <span class='fl'>2</span>, <span class='fl'>4</span>, <span class='fl'>6</span>, <span class='fl'>13</span>, <span class='fl'>17</span>))
# resistance of ciprofloxacine per age group <span class='co'># resistance of ciprofloxacine per age group</span>
library(dplyr) <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>dplyr</span>)
septic_patients %>% <span class='no'>septic_patients</span> <span class='kw'>%&gt;%</span>
filter_first_isolate) %>% <span class='fu'><a href='first_isolate.html'>filter_first_isolate</a></span>() <span class='kw'>%&gt;%</span>
filter(mo == as.mo("E. coli")) %>% <span class='fu'><a href='https://dplyr.tidyverse.org/reference/filter.html'>filter</a></span>(<span class='no'>mo</span> <span class='kw'>==</span> <span class='fu'><a href='as.mo.html'>as.mo</a></span>(<span class='st'>"E. coli"</span>)) <span class='kw'>%&gt;%</span>
group_by(age_group = age_groups(age)) %>% <span class='fu'><a href='https://dplyr.tidyverse.org/reference/group_by.html'>group_by</a></span>(<span class='kw'>age_group</span> <span class='kw'>=</span> <span class='fu'>age_groups</span>(<span class='no'>age</span>)) <span class='kw'>%&gt;%</span>
select(age_group, CIP) %>% <span class='fu'><a href='https://dplyr.tidyverse.org/reference/select.html'>select</a></span>(<span class='no'>age_group</span>, <span class='no'>CIP</span>) <span class='kw'>%&gt;%</span>
ggplot_rsi(x = "age_group") <span class='fu'><a href='ggplot_rsi.html'>ggplot_rsi</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"age_group"</span>)
# } <span class='co'># }</span></pre>
</pre>
</div> </div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar"> <div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2> <h2>Contents</h2>

View File

@ -80,7 +80,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9040</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>
@ -252,8 +252,8 @@
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>facet</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>), <span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>facet</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>breaks</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/seq'>seq</a></span>(<span class='fl'>0</span>, <span class='fl'>1</span>, <span class='fl'>0.1</span>),
<span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>limits</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>combine_SI</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
<span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>, <span class='kw'>combine_IR</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>language</span> <span class='kw'>=</span> <span class='fu'><a href='translate.html'>get_locale</a></span>(), <span class='kw'>fun</span> <span class='kw'>=</span> <span class='no'>count_df</span>,
<span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>nrow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>datalabels</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>, <span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>,
<span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"grey15"</span>, <span class='no'>...</span>) <span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"white"</span>, <span class='no'>...</span>)
<span class='fu'>geom_rsi</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"Antibiotic"</span>, <span class='st'>"Interpretation"</span>), <span class='fu'>geom_rsi</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='st'>"Antibiotic"</span>, <span class='st'>"Interpretation"</span>),
<span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>, <span class='kw'>fill</span> <span class='kw'>=</span> <span class='st'>"Interpretation"</span>, <span class='kw'>translate_ab</span> <span class='kw'>=</span> <span class='st'>"name"</span>,
@ -269,7 +269,7 @@
<span class='fu'>theme_rsi</span>() <span class='fu'>theme_rsi</span>()
<span class='fu'>labels_rsi_count</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Antibiotic"</span>, <span class='fu'>labels_rsi_count</span>(<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Antibiotic"</span>,
<span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"grey15"</span>)</pre> <span class='kw'>datalabels.size</span> <span class='kw'>=</span> <span class='fl'>3</span>, <span class='kw'>datalabels.colour</span> <span class='kw'>=</span> <span class='st'>"white"</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">

View File

@ -78,7 +78,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">AMR (for R)</a> <a class="navbar-link" href="../index.html">AMR (for R)</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9042</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.6.1.9043</span>
</span> </span>
</div> </div>

View File

@ -55,7 +55,7 @@ echo "••••••••••••••••••••••••
echo "• Uploading to repository •" echo "• Uploading to repository •"
echo "•••••••••••••••••••••••••••" echo "•••••••••••••••••••••••••••"
git add . git add .
git commit -a -m "$1" --quiet git commit -a -m "(v$new_version) $1" --quiet
git push --quiet git push --quiet
echo "Comparison:" echo "Comparison:"
echo "https://gitlab.com/msberends/AMR/compare/master...premaster?view=inline" echo "https://gitlab.com/msberends/AMR/compare/master...premaster?view=inline"

View File

@ -61,7 +61,7 @@ age_groups(ages, c(1, 2, 4, 6, 13, 17))
# resistance of ciprofloxacine per age group # resistance of ciprofloxacine per age group
library(dplyr) library(dplyr)
septic_patients \%>\% septic_patients \%>\%
filter_first_isolate) \%>\% filter_first_isolate() \%>\%
filter(mo == as.mo("E. coli")) \%>\% filter(mo == as.mo("E. coli")) \%>\%
group_by(age_group = age_groups(age)) \%>\% group_by(age_group = age_groups(age)) \%>\%
select(age_group, CIP) \%>\% select(age_group, CIP) \%>\%

View File

@ -14,8 +14,8 @@ ggplot_rsi(data, position = NULL, x = "Antibiotic",
fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1), fill = "Interpretation", facet = NULL, breaks = seq(0, 1, 0.1),
limits = NULL, translate_ab = "name", combine_SI = TRUE, limits = NULL, translate_ab = "name", combine_SI = TRUE,
combine_IR = FALSE, language = get_locale(), fun = count_df, combine_IR = FALSE, language = get_locale(), fun = count_df,
nrow = NULL, datalabels = TRUE, datalabels.size = 3, nrow = NULL, datalabels = FALSE, datalabels.size = 3,
datalabels.colour = "grey15", ...) datalabels.colour = "white", ...)
geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"), geom_rsi(position = NULL, x = c("Antibiotic", "Interpretation"),
fill = "Interpretation", translate_ab = "name", fill = "Interpretation", translate_ab = "name",
@ -31,7 +31,7 @@ scale_rsi_colours()
theme_rsi() theme_rsi()
labels_rsi_count(position = NULL, x = "Antibiotic", labels_rsi_count(position = NULL, x = "Antibiotic",
datalabels.size = 3, datalabels.colour = "grey15") datalabels.size = 3, datalabels.colour = "white")
} }
\arguments{ \arguments{
\item{data}{a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}})} \item{data}{a \code{data.frame} with column(s) of class \code{"rsi"} (see \code{\link{as.rsi}})}