mirror of
https://github.com/msberends/AMR.git
synced 2026-10-01 04:13:33 +02:00
pm update, unit test fix?
This commit is contained in:
1 parent
4a54d59f70
commit
822e9de82c
13 files changed
+2117
-719
No files matched your search
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
Package: AMR
|
Package: AMR
|
||||||
Version: 1.8.2.9109
|
Version: 1.8.2.9110
|
||||||
Date: 2023-02-06
|
Date: 2023-02-08
|
||||||
Title: Antimicrobial Resistance Data Analysis
|
Title: Antimicrobial Resistance Data Analysis
|
||||||
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
|
||||||
data analysis and to work with microbial and antimicrobial properties by
|
data analysis and to work with microbial and antimicrobial properties by
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# AMR 1.8.2.9109
|
# AMR 1.8.2.9110
|
||||||
|
|
||||||
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
*(this beta version will eventually become v2.0! We're happy to reach a new major milestone soon!)*
|
||||||
|
|
||||||
|
|||||||
Executable → Regular
+1126
-613
File diff suppressed because it is too large.
Load diff
+15
-53
@@ -1425,13 +1425,15 @@ case_when <- function(...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# dplyr implementations ----
|
# dplyr/tidyr implementations ----
|
||||||
|
|
||||||
# take {dplyr} functions if available, and the slower {poorman} functions otherwise
|
# take {dplyr} and {tidyr} functions if available, and the slower {poorman} functions otherwise
|
||||||
if (pkg_is_available("dplyr", also_load = FALSE)) {
|
if (pkg_is_available("dplyr", min_version = "1.0.0", also_load = FALSE)) {
|
||||||
`%>%` <- import_fn("%>%", "dplyr", error_on_fail = FALSE)
|
`%>%` <- import_fn("%>%", "dplyr", error_on_fail = FALSE)
|
||||||
|
across <- import_fn("across", "dplyr", error_on_fail = FALSE)
|
||||||
anti_join <- import_fn("anti_join", "dplyr", error_on_fail = FALSE)
|
anti_join <- import_fn("anti_join", "dplyr", error_on_fail = FALSE)
|
||||||
arrange <- import_fn("arrange", "dplyr", error_on_fail = FALSE)
|
arrange <- import_fn("arrange", "dplyr", error_on_fail = FALSE)
|
||||||
|
bind_rows <- import_fn("bind_rows", "dplyr", error_on_fail = FALSE)
|
||||||
count <- import_fn("count", "dplyr", error_on_fail = FALSE)
|
count <- import_fn("count", "dplyr", error_on_fail = FALSE)
|
||||||
desc <- import_fn("desc", "dplyr", error_on_fail = FALSE)
|
desc <- import_fn("desc", "dplyr", error_on_fail = FALSE)
|
||||||
distinct <- import_fn("distinct", "dplyr", error_on_fail = FALSE)
|
distinct <- import_fn("distinct", "dplyr", error_on_fail = FALSE)
|
||||||
@@ -1443,22 +1445,22 @@ if (pkg_is_available("dplyr", also_load = FALSE)) {
|
|||||||
inner_join <- import_fn("inner_join", "dplyr", error_on_fail = FALSE)
|
inner_join <- import_fn("inner_join", "dplyr", error_on_fail = FALSE)
|
||||||
lag <- import_fn("lag", "dplyr", error_on_fail = FALSE)
|
lag <- import_fn("lag", "dplyr", error_on_fail = FALSE)
|
||||||
left_join <- import_fn("left_join", "dplyr", error_on_fail = FALSE)
|
left_join <- import_fn("left_join", "dplyr", error_on_fail = FALSE)
|
||||||
|
mutate <- import_fn("mutate", "dplyr", error_on_fail = FALSE)
|
||||||
n_distinct <- import_fn("n_distinct", "dplyr", error_on_fail = FALSE)
|
n_distinct <- import_fn("n_distinct", "dplyr", error_on_fail = FALSE)
|
||||||
pull <- import_fn("pull", "dplyr", error_on_fail = FALSE)
|
pull <- import_fn("pull", "dplyr", error_on_fail = FALSE)
|
||||||
rename <- import_fn("rename", "dplyr", error_on_fail = FALSE)
|
rename <- import_fn("rename", "dplyr", error_on_fail = FALSE)
|
||||||
right_join <- import_fn("right_join", "dplyr", error_on_fail = FALSE)
|
right_join <- import_fn("right_join", "dplyr", error_on_fail = FALSE)
|
||||||
row_number <- import_fn("row_number", "dplyr", error_on_fail = FALSE)
|
|
||||||
select <- import_fn("select", "dplyr", error_on_fail = FALSE)
|
select <- import_fn("select", "dplyr", error_on_fail = FALSE)
|
||||||
semi_join <- import_fn("semi_join", "dplyr", error_on_fail = FALSE)
|
semi_join <- import_fn("semi_join", "dplyr", error_on_fail = FALSE)
|
||||||
summarise <- import_fn("summarise", "dplyr", error_on_fail = FALSE)
|
summarise <- import_fn("summarise", "dplyr", error_on_fail = FALSE)
|
||||||
ungroup <- import_fn("ungroup", "dplyr", error_on_fail = FALSE)
|
ungroup <- import_fn("ungroup", "dplyr", error_on_fail = FALSE)
|
||||||
mutate <- import_fn("mutate", "dplyr", error_on_fail = FALSE)
|
|
||||||
bind_rows <- import_fn("bind_rows", "dplyr", error_on_fail = FALSE)
|
|
||||||
where <- import_fn("where", "dplyr", error_on_fail = FALSE)
|
where <- import_fn("where", "dplyr", error_on_fail = FALSE)
|
||||||
} else {
|
} else {
|
||||||
`%>%` <- `%pm>%`
|
`%>%` <- `%pm>%`
|
||||||
|
across <- pm_across
|
||||||
anti_join <- pm_anti_join
|
anti_join <- pm_anti_join
|
||||||
arrange <- pm_arrange
|
arrange <- pm_arrange
|
||||||
|
bind_rows <- pm_bind_rows
|
||||||
count <- pm_count
|
count <- pm_count
|
||||||
desc <- pm_desc
|
desc <- pm_desc
|
||||||
distinct <- pm_distinct
|
distinct <- pm_distinct
|
||||||
@@ -1470,62 +1472,22 @@ if (pkg_is_available("dplyr", also_load = FALSE)) {
|
|||||||
inner_join <- pm_inner_join
|
inner_join <- pm_inner_join
|
||||||
lag <- pm_lag
|
lag <- pm_lag
|
||||||
left_join <- pm_left_join
|
left_join <- pm_left_join
|
||||||
|
mutate <- pm_mutate
|
||||||
n_distinct <- pm_n_distinct
|
n_distinct <- pm_n_distinct
|
||||||
pull <- pm_pull
|
pull <- pm_pull
|
||||||
rename <- pm_rename
|
rename <- pm_rename
|
||||||
right_join <- pm_right_join
|
right_join <- pm_right_join
|
||||||
row_number <- pm_row_number
|
|
||||||
select <- pm_select
|
select <- pm_select
|
||||||
semi_join <- pm_semi_join
|
semi_join <- pm_semi_join
|
||||||
summarise <- pm_summarise
|
summarise <- pm_summarise
|
||||||
ungroup <- pm_ungroup
|
ungroup <- pm_ungroup
|
||||||
mutate <- function(.data, ...) {
|
where <- pm_where
|
||||||
# pm_mutate is buggy, use this simple alternative
|
}
|
||||||
dots <- list(...)
|
if (pkg_is_available("tidyr", min_version = "1.0.0", also_load = FALSE)) {
|
||||||
for (i in seq_len(length(dots))) {
|
pivot_longer <- import_fn("pivot_longer", "tidyr", error_on_fail = FALSE)
|
||||||
.data[, names(dots)[i]] <- dots[[i]]
|
} else {
|
||||||
}
|
pivot_longer <- pm_pivot_longer
|
||||||
.data
|
|
||||||
}
|
|
||||||
bind_rows <- function(..., fill = NA) {
|
|
||||||
# this AMAZING code is from ChatGPT when I asked for a base R dplyr::bind_rows alternative
|
|
||||||
dfs <- list(...)
|
|
||||||
all_cols <- unique(unlist(lapply(dfs, colnames)))
|
|
||||||
mat_list <- lapply(dfs, function(x) {
|
|
||||||
mat <- matrix(NA, nrow = nrow(x), ncol = length(all_cols))
|
|
||||||
colnames(mat) <- all_cols
|
|
||||||
mat[, colnames(x)] <- as.matrix(x)
|
|
||||||
mat
|
|
||||||
})
|
|
||||||
mat <- do.call(rbind, mat_list)
|
|
||||||
as.data.frame(mat, stringsAsFactors = FALSE)
|
|
||||||
}
|
|
||||||
where <- function(fn) {
|
|
||||||
# adapted from https://github.com/nathaneastwood/poorman/blob/52eb6947e0b4430cd588976ed8820013eddf955f/R/where.R#L17-L32
|
|
||||||
if (!is.function(fn)) {
|
|
||||||
stop_("`", deparse(substitute(fn)), "()` is not a valid predicate function.")
|
|
||||||
}
|
|
||||||
df <- pm_select_env$.data
|
|
||||||
cols <- pm_select_env$get_colnames()
|
|
||||||
if (is.null(df)) {
|
|
||||||
df <- get_current_data("where", call = FALSE)
|
|
||||||
cols <- colnames(df)
|
|
||||||
}
|
|
||||||
preds <- unlist(lapply(
|
|
||||||
df,
|
|
||||||
function(x, fn) {
|
|
||||||
do.call("fn", list(x))
|
|
||||||
},
|
|
||||||
fn
|
|
||||||
))
|
|
||||||
if (!is.logical(preds)) stop_("`where()` must be used with functions that return `TRUE` or `FALSE`.")
|
|
||||||
data_cols <- cols
|
|
||||||
cols <- data_cols[preds]
|
|
||||||
which(data_cols %in% cols)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Faster data.table implementations ----
|
# Faster data.table implementations ----
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#' @return (internally) a [character] vector of column names, with additional class `"ab_selector"`
|
#' @return (internally) a [character] vector of column names, with additional class `"ab_selector"`
|
||||||
#' @export
|
#' @export
|
||||||
#' @inheritSection AMR Reference Data Publicly Available
|
#' @inheritSection AMR Reference Data Publicly Available
|
||||||
|
|
||||||
#' @examples
|
#' @examples
|
||||||
#' # `example_isolates` is a data set available in the AMR package.
|
#' # `example_isolates` is a data set available in the AMR package.
|
||||||
#' # See ?example_isolates.
|
#' # See ?example_isolates.
|
||||||
|
|||||||
@@ -85,10 +85,7 @@ bug_drug_combinations <- function(x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
# use dplyr and tidyr if they are available, they are much faster!
|
# use dplyr and tidyr if they are available, they are much faster!
|
||||||
if (pkg_is_available("dplyr", min_version = "1.0.0", also_load = FALSE) &&
|
if (identical(pivot_longer, import_fn("pivot_longer", "tidyr", error_on_fail = FALSE))) {
|
||||||
pkg_is_available("tidyr", min_version = "1.0.0", also_load = FALSE)) {
|
|
||||||
across <- import_fn("across", "dplyr")
|
|
||||||
pivot_longer <- import_fn("pivot_longer", "tidyr")
|
|
||||||
out <- x %>%
|
out <- x %>%
|
||||||
ungroup() %>%
|
ungroup() %>%
|
||||||
mutate(mo = FUN(ungroup(x)[, col_mo, drop = TRUE], ...)) %>%
|
mutate(mo = FUN(ungroup(x)[, col_mo, drop = TRUE], ...)) %>%
|
||||||
|
|||||||
+1
-1
@@ -926,7 +926,7 @@ eucast_rules <- function(x,
|
|||||||
# Print overview ----------------------------------------------------------
|
# Print overview ----------------------------------------------------------
|
||||||
if (isTRUE(info) || isTRUE(verbose)) {
|
if (isTRUE(info) || isTRUE(verbose)) {
|
||||||
verbose_info <- x.bak %>%
|
verbose_info <- x.bak %>%
|
||||||
mutate(row = row_number()) %>%
|
mutate(row = seq_len(NROW(x.bak))) %>%
|
||||||
select(`.rowid`, row) %>%
|
select(`.rowid`, row) %>%
|
||||||
right_join(verbose_info,
|
right_join(verbose_info,
|
||||||
by = c(".rowid" = "rowid")
|
by = c(".rowid" = "rowid")
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
title: "Generating antibiograms with the AMR package"
|
||||||
|
author: "AMR package developers"
|
||||||
|
date: "`r Sys.Date()`"
|
||||||
|
output: html_document
|
||||||
|
---
|
||||||
|
|
||||||
|
```{r setup, include=FALSE}
|
||||||
|
knitr::opts_chunk$set(echo = TRUE, message = FALSE)
|
||||||
|
library(AMR)
|
||||||
|
```
|
||||||
|
|
||||||
|
This is an example R Markdown file to show the use of `antibiogram()` of the AMR package.
|
||||||
|
|
||||||
|
For starters, this is what our `example_isolates` data set looks like:
|
||||||
|
|
||||||
|
```{r}
|
||||||
|
example_isolates
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Traditional Antibiogram
|
||||||
|
|
||||||
|
```{r trad}
|
||||||
|
print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c(aminoglycosides(), carbapenems()))
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Combined Antibiogram
|
||||||
|
|
||||||
|
```{r comb}
|
||||||
|
print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"))
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Syndromic Antibiogram
|
||||||
|
|
||||||
|
```{r synd}
|
||||||
|
print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c(aminoglycosides(), carbapenems()),
|
||||||
|
syndromic_group = "ward")
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
### Weighted-Incidence Syndromic Combination Antibiogram (WISCA)
|
||||||
|
|
||||||
|
```{r wisca}
|
||||||
|
print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c("AMC", "AMC+CIP", "TZP", "TZP+TOB"),
|
||||||
|
mo_transform = "gramstain",
|
||||||
|
minimum = 10, # this should be >= 30, but now just as example
|
||||||
|
syndromic_group = ifelse(example_isolates$age >= 65 &
|
||||||
|
example_isolates$gender == "M",
|
||||||
|
"WISCA Group 1", "WISCA Group 2"))
|
||||||
|
)
|
||||||
|
```
|
||||||
@@ -0,0 +1,848 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="generator" content="pandoc" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
|
||||||
|
|
||||||
|
|
||||||
|
<meta name="author" content="AMR package developers" />
|
||||||
|
|
||||||
|
<meta name="date" content="2023-02-08" />
|
||||||
|
|
||||||
|
<title>Generating antibiograms with the AMR package</title>
|
||||||
|
|
||||||
|
<script>// Pandoc 2.9 adds attributes on both header and div. We remove the former (to
|
||||||
|
// be compatible with the behavior of Pandoc < 2.8).
|
||||||
|
document.addEventListener('DOMContentLoaded', function(e) {
|
||||||
|
var hs = document.querySelectorAll("div.section[class*='level'] > :first-child");
|
||||||
|
var i, h, a;
|
||||||
|
for (i = 0; i < hs.length; i++) {
|
||||||
|
h = hs[i];
|
||||||
|
if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6
|
||||||
|
a = h.attributes;
|
||||||
|
while (a.length > 0) h.removeAttribute(a[0].name);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<script>/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */
|
||||||
|
!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^Line truncated
|
||||||
|
</script>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<style type="text/css">html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(data:application/vnd.ms-fontobject;base64,n04AAEFNAAACAAIABAAAAAAABQAAAAAAAAABAJABAAAEAExQAAAAAAAAAAIAAAAAAAAAAAEAAAAAAAAAJxJ/LAAAAAAAAAAAAAAAAAAAAAAAACgARwBMAFkAUABIAEkAQwBPAE4AUwAgAEgAYQBsAGYAbABpAG4AZwBzAAAADgBSAGUAZwB1AGwAYQByAAAAeABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAA5ADsAUABTACAAMAAwADEALgAwADAAOQA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADcAMAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADUAOAAzADIAOQAAADgARwBMAFkAUABIAEkAQwBPAE4AUwAgAEgAYQBsAGYAbABpAG4AZwBzACAAUgBlAGcAdQBsAGEAcgAAAAAAQlNHUAAAAAAAAAAAAAAAAAAAAAADAKncAE0TAE0ZAEbuFM3pjM/SEdmjKHUbyow8ATBE40IvWA3vTu8LiABDQ+pexwUMcm1SMnNryctQSiI1K5ZnbOlXKmnVV5YvRe6RnNMFNCOs1KNVpn6yZhCJkRtVRNzEufeIq7HgSrcx4S8h/v4vnrrKc6oCNxmSk2uKlZQHBii6iKFoH0746ThvkO1kJHlxjrkxs+LWORaDQBEtiYJIR5IB9Bi1UyL4Rmr0BNigNkMzlKQmnofBHviqVzUxwdMb3NdCn69hy+pRYVKGVS/1tnsqv4LL7wCCPZZAZPT4aCShHjHJVNuXbmMrY5LeQaGnvAkXlVrJgKRAUdFjrWEah9XebPeQMj7KS7DIBAFt8ycgC5PLGUOHSE3ErGZCiViNLL5ZARfywnCoZaKQCu6NuFX42AEeKtKUGnr/Cm2Cy8tpFhBPMW5Fxi4Qm4TkDWh4IWFDClhU2hRWosUWqcKLlgyXB+lSHaWaHiWlBAR8SeSgSPCQxdVQgzUixWKSTrIQEbU94viDctkvX+VSjJuUmV8L4CXShI11esnp0pjWNZIyxKHS4wVQ2ime1P4RnhvGw0aDN1OLAXGERsB7buFpFGGBAre4QEQR0HOIO5oYH305G+KspT/FupEGGafCCwxSe6ZUa+073rXHnNdVXE6eWvibUS27XtRzkH838mYLMBmYysZTM0EM3A1fbpCBYFccN1B/EnCYu/TgCGmr7bMh8GfYL+BfcLvB0gRagC09w9elfldaIy/hNCBLRgBgtCC7jAF63wLSMAfbfAlEggYU0bUA7ACCJmTDpEmJtI78w4/BO7dN7JR7J7ZvbYaUbaILSQsRBiF3HGk5fEg6p9unwLvn98r+vnsV+372uf1xBLq4qU/45fTuqaAP+pssmCCCTF0mhEow8ZXZOS8D7Q85JsxZ+Azok7B7O/f6J8AzYBySZQB/QHYUSA+EeQhEWiS6AIQzgcsDiER4MjgMBAWDV4AgQ3g1eBgIdweCQmCjJEMkJ+PKRWyFHHmg1Wi/6xzUgA0LREoKJChwnQa9B+5RQZRB3IlBlkAnxyQNaANwHMowzlYSMCBgnbpzvqpl0iTJNCQidDI9ZrSYNIRBhHtUa5YHMHxyGEik9hDE0AKj72AbTCaxtHPUaKZdAZSnQTyjGqGLsmBStCejApUhg4uBMU6mATujEl+KdDPbI6Ag4vLr+hjY6lbjBeoLKnZl0UZgRX8gTySOeynZVz1wOq7e1hFGYIq+MhrGxDLak0PrwYzSXtcuyhXEhwOYofiW+EcI/jw8P6IY6ed+etAbuqKp5QIapT77LnAe505lMuqL79a0ut4rWexzFttsOsLDy7zvtQzcq3U1qabe7tB0wHWVXji+zDbo8x8HyIRUbXnwUcklFv51fvTymiV+MXLSmGH9d9+aXpD5X6lao41anWGig7IwIdnoBY2ht/pO9mClLo4NdXHAsefqWUKlXJkbqPOFhMoR4aiA1BXqhRNbB2Xwi+7u/jpAoOpKJ0UX24EsrzMfHXViakCNcKjBxuQX8BO0ZqjJ3xXzf+61t2VXOSgJ8xu65QKgtLine truncated
|
||||||
|
</style>
|
||||||
|
<script>/*!
|
||||||
|
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
||||||
|
* Copyright 2011-2015 Twitter, Inc.
|
||||||
|
* Licensed under the MIT license
|
||||||
|
*/
|
||||||
|
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&cLine truncated
|
||||||
|
d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.5",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);</script>
|
||||||
|
<script>/**
|
||||||
|
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||||
|
*/
|
||||||
|
// Only run this code in IE 8
|
||||||
|
if (!!window.navigator.userAgent.match("MSIE 8")) {
|
||||||
|
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.2",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b)}(this,document);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<script>/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
|
||||||
|
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
|
||||||
|
* */
|
||||||
|
|
||||||
|
// Only run this code in IE 8
|
||||||
|
if (!!window.navigator.userAgent.match("MSIE 8")) {
|
||||||
|
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style>h1 {font-size: 34px;}
|
||||||
|
h1.title {font-size: 38px;}
|
||||||
|
h2 {font-size: 30px;}
|
||||||
|
h3 {font-size: 24px;}
|
||||||
|
h4 {font-size: 18px;}
|
||||||
|
h5 {font-size: 16px;}
|
||||||
|
h6 {font-size: 12px;}
|
||||||
|
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
|
||||||
|
pre:not([class]) { background-color: white }</style>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* jQuery Plugin: Sticky Tabs
|
||||||
|
*
|
||||||
|
* @author Aidan Lister <aidan@php.net>
|
||||||
|
* adapted by Ruben Arslan to activate parent tabs too
|
||||||
|
* http://www.aidanlister.com/2014/03/persisting-the-tab-state-in-bootstrap/
|
||||||
|
*/
|
||||||
|
(function($) {
|
||||||
|
"use strict";
|
||||||
|
$.fn.rmarkdownStickyTabs = function() {
|
||||||
|
var context = this;
|
||||||
|
// Show the tab corresponding with the hash in the URL, or the first tab
|
||||||
|
var showStuffFromHash = function() {
|
||||||
|
var hash = window.location.hash;
|
||||||
|
var selector = hash ? 'a[href="' + hash + '"]' : 'li.active > a';
|
||||||
|
var $selector = $(selector, context);
|
||||||
|
if($selector.data('toggle') === "tab") {
|
||||||
|
$selector.tab('show');
|
||||||
|
// walk up the ancestors of this element, show any hidden tabs
|
||||||
|
$selector.parents('.section.tabset').each(function(i, elm) {
|
||||||
|
var link = $('a[href="#' + $(elm).attr('id') + '"]');
|
||||||
|
if(link.data('toggle') === "tab") {
|
||||||
|
link.tab("show");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Set the correct tab when the page loads
|
||||||
|
showStuffFromHash(context);
|
||||||
|
|
||||||
|
// Set the correct tab when a user uses their back/forward button
|
||||||
|
$(window).on('hashchange', function() {
|
||||||
|
showStuffFromHash(context);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Change the URL when tabs are clicked
|
||||||
|
$('a', context).on('click', function(e) {
|
||||||
|
history.pushState(null, null, this.href);
|
||||||
|
showStuffFromHash(context);
|
||||||
|
});
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
}(jQuery));
|
||||||
|
|
||||||
|
window.buildTabsets = function(tocID) {
|
||||||
|
|
||||||
|
// build a tabset from a section div with the .tabset class
|
||||||
|
function buildTabset(tabset) {
|
||||||
|
|
||||||
|
// check for fade and pills options
|
||||||
|
var fade = tabset.hasClass("tabset-fade");
|
||||||
|
var pills = tabset.hasClass("tabset-pills");
|
||||||
|
var navClass = pills ? "nav-pills" : "nav-tabs";
|
||||||
|
|
||||||
|
// determine the heading level of the tabset and tabs
|
||||||
|
var match = tabset.attr('class').match(/level(\d) /);
|
||||||
|
if (match === null)
|
||||||
|
return;
|
||||||
|
var tabsetLevel = Number(match[1]);
|
||||||
|
var tabLevel = tabsetLevel + 1;
|
||||||
|
|
||||||
|
// find all subheadings immediately below
|
||||||
|
var tabs = tabset.find("div.section.level" + tabLevel);
|
||||||
|
if (!tabs.length)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// create tablist and tab-content elements
|
||||||
|
var tabList = $('<ul class="nav ' + navClass + '" role="tablist"></ul>');
|
||||||
|
$(tabs[0]).before(tabList);
|
||||||
|
var tabContent = $('<div class="tab-content"></div>');
|
||||||
|
$(tabs[0]).before(tabContent);
|
||||||
|
|
||||||
|
// build the tabset
|
||||||
|
var activeTab = 0;
|
||||||
|
tabs.each(function(i) {
|
||||||
|
|
||||||
|
// get the tab div
|
||||||
|
var tab = $(tabs[i]);
|
||||||
|
|
||||||
|
// get the id then sanitize it for use with bootstrap tabs
|
||||||
|
var id = tab.attr('id');
|
||||||
|
|
||||||
|
// see if this is marked as the active tab
|
||||||
|
if (tab.hasClass('active'))
|
||||||
|
activeTab = i;
|
||||||
|
|
||||||
|
// remove any table of contents entries associated with
|
||||||
|
// this ID (since we'll be removing the heading element)
|
||||||
|
$("div#" + tocID + " li a[href='#" + id + "']").parent().remove();
|
||||||
|
|
||||||
|
// sanitize the id for use with bootstrap tabs
|
||||||
|
id = id.replace(/[.\/?&!#<>]/g, '').replace(/\s/g, '_');
|
||||||
|
tab.attr('id', id);
|
||||||
|
|
||||||
|
// get the heading element within it, grab it's text, then remove it
|
||||||
|
var heading = tab.find('h' + tabLevel + ':first');
|
||||||
|
var headingText = heading.html();
|
||||||
|
heading.remove();
|
||||||
|
|
||||||
|
// build and append the tab list item
|
||||||
|
var a = $('<a role="tab" data-toggle="tab">' + headingText + '</a>');
|
||||||
|
a.attr('href', '#' + id);
|
||||||
|
a.attr('aria-controls', id);
|
||||||
|
var li = $('<li role="presentation"></li>');
|
||||||
|
li.append(a);
|
||||||
|
tabList.append(li);
|
||||||
|
|
||||||
|
// set it's attributes
|
||||||
|
tab.attr('role', 'tabpanel');
|
||||||
|
tab.addClass('tab-pane');
|
||||||
|
tab.addClass('tabbed-pane');
|
||||||
|
if (fade)
|
||||||
|
tab.addClass('fade');
|
||||||
|
|
||||||
|
// move it into the tab content div
|
||||||
|
tab.detach().appendTo(tabContent);
|
||||||
|
});
|
||||||
|
|
||||||
|
// set active tab
|
||||||
|
$(tabList.children('li')[activeTab]).addClass('active');
|
||||||
|
var active = $(tabContent.children('div.section')[activeTab]);
|
||||||
|
active.addClass('active');
|
||||||
|
if (fade)
|
||||||
|
active.addClass('in');
|
||||||
|
|
||||||
|
if (tabset.hasClass("tabset-sticky"))
|
||||||
|
tabset.rmarkdownStickyTabs();
|
||||||
|
}
|
||||||
|
|
||||||
|
// convert section divs with the .tabset class to tabsets
|
||||||
|
var tabsets = $("div.section.tabset");
|
||||||
|
tabsets.each(function(i) {
|
||||||
|
buildTabset($(tabsets[i]));
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style type="text/css">.hljs-literal {
|
||||||
|
color: #990073;
|
||||||
|
}
|
||||||
|
.hljs-number {
|
||||||
|
color: #099;
|
||||||
|
}
|
||||||
|
.hljs-comment {
|
||||||
|
color: #998;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
.hljs-keyword {
|
||||||
|
color: #900;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.hljs-string {
|
||||||
|
color: #d14;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script src="data:application/javascript;base64,LyohIGhpZ2hsaWdodC5qcyB2OS4xMi4wIHwgQlNEMyBMaWNlbnNlIHwgZ2l0LmlvL2hsanNsaWNlbnNlICovCiFmdW5jdGlvbihlKXt2YXIgbj0ib2JqZWN0Ij09dHlwZW9mIHdpbmRvdyYmd2luZG93fHwib2JqZWN0Ij09dHlwZW9mIHNlbGYmJnNlbGY7InVuZGVmaW5lZCIhPXR5cGVvZiBleHBvcnRzP2UoZXhwb3J0cyk6biYmKG4uaGxqcz1lKHt9KSwiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kJiZkZWZpbmUoW10sZnVuY3Rpb24oKXtyZXR1cm4gbi5obGpzfSkpfShmdW5jdGlvbihlKXtmdW5jdGlvbiBuKGUpe3JldHVybiBlLnJlcGxhY2UoLyYvZywiJmFtcDsiKS5yZXBsYWNlKC88L2csIiZsdDsiKS5yZXBsYWNlKC8+L2csIiZndDsiKX1mdW5jdGlvbiB0KGUpe3JldHVybiBlLm5vZGVOYW1lLnRvTG93ZXJDYXNlKCl9ZnVuY3Rpb24gcihlLG4pe3ZhciB0PWUmJmUuZXhlYyhuKTtyZXR1cm4gdCYmMD09PXQuaW5kZXh9ZnVuY3Rpb24gYShlKXtyZXR1cm4gay50ZXN0KGUpfWZ1bmN0aW9uIGkoZSl7dmFyIG4sdCxyLGksbz1lLmNsYXNzTmFtZSsiICI7aWYobys9ZS5wYXJlbnROb2RlP2UucGFyZW50Tm9kZS5jbGFzc05hbWU6IiIsdD1CLmV4ZWMobykpcmV0dXJuIHcodFsxXSk/dFsxXToibm8taGlnaGxpZ2h0Ijtmb3Iobz1vLnNwbGl0KC9ccysvKSxuPTAscj1vLmxlbmd0aDtyPm47bisrKWlmKGk9b1tuXSxhKGkpfHx3KGkpKXJldHVybiBpfWZ1bmN0aW9uIG8oZSl7dmFyIG4sdD17fSxyPUFycmF5LnByb3RvdHlwZS5zbGljZS5jYWxsKGFyZ3VtZW50cywxKTtmb3IobiBpbiBlKXRbbl09ZVtuXTtyZXR1cm4gci5mb3JFYWNoKGZ1bmN0aW9uKGUpe2ZvcihuIGluIGUpdFtuXT1lW25dfSksdH1mdW5jdGlvbiB1KGUpe3ZhciBuPVtdO3JldHVybiBmdW5jdGlvbiByKGUsYSl7Zm9yKHZhciBpPWUuZmlyc3RDaGlsZDtpO2k9aS5uZXh0U2libGluZykzPT09aS5ub2RlVHlwZT9hKz1pLm5vZGVWYWx1ZS5sZW5ndGg6MT09PWkubm9kZVR5cGUmJihuLnB1c2goe2V2ZW50OiJzdGFydCIsb2Zmc2V0OmEsbm9kZTppfSksYT1yKGksYSksdChpKS5tYXRjaCgvYnJ8aHJ8aW1nfGlucHV0Lyl8fG4ucHVzaCh7ZXZlbnQ6InN0b3AiLG9mZnNldDphLG5vZGU6aX0pKTtyZXR1cm4gYX0oZSwwKSxufWZ1bmN0aW9uIGMoZSxyLGEpe2Z1bmN0aW9uIGkoKXtyZXR1cm4gZS5sZW5ndGgmJnIubGVuZ3RoP2VbMF0ub2Zmc2V0IT09clswXS5vZmZzZXQ/ZVswXS5vZmZzZXQ8clswXS5vZmZzZXQ/ZTpyOiJzdGFydCI9PT1yWzBdLmV2ZW50P2U6cjplLmxlbmd0aD9lOnJ9ZnVuY3Rpb24gbyhlKXtmdW5jdGlvbiByKGUpe3JldHVybiIgIitlLm5vZGVOYW1lKyc9IicrbihlLnZhbHVlKS5yZXBsYWNlKCciJywiJnF1b3Q7IikrJyInfXMrPSI8Iit0KGUpK0UubWFwLmNhbGwoZS5hdHRyaWJ1dGVzLHIpLmpvaW4oIiIpKyI+In1mdW5jdGlvbiB1KGUpe3MrPSI8LyIrdChlKSsiPiJ9ZnVuY3Rpb24gYyhlKXsoInN0YXJ0Ij09PWUuZXZlbnQ/bzp1KShlLm5vZGUpfWZvcih2YXIgbD0wLHM9IiIsZj1bXTtlLmxlbmd0aHx8ci5sZW5ndGg7KXt2YXIgZz1pKCk7aWYocys9bihhLnN1YnN0cmluZyhsLGdbMF0ub2Zmc2V0KSksbD1nWzBdLm9mZnNldCxnPT09ZSl7Zi5yZXZlcnNlKCkuZm9yRWFjaCh1KTtkbyBjKGcuc3BsaWNlKDAsMSlbMF0pLGc9aSgpO3doaWxlKGc9PT1lJiZnLmxlbmd0aCYmZ1swXS5vZmZzZXQ9PT1sKTtmLnJldmVyc2UoKS5mb3JFYWNoKG8pfWVsc2Uic3RhcnQiPT09Z1swXS5ldmVudD9mLnB1c2goZ1swXS5ub2RlKTpmLnBvcCgpLGMoZy5zcGxpY2UoMCwxKVswXSl9cmV0dXJuIHMrbihhLnN1YnN0cihsKSl9ZnVuY3Rpb24gbChlKXtyZXR1cm4gZS52JiYhZS5jYWNoZWRfdmFyaWFudHMmJihlLmNhY2hlZF92YXJpYW50cz1lLnYubWFwKGZ1bmN0aW9uKG4pe3JldHVybiBvKGUse3Y6bnVsbH0sbil9KSksZS5jYWNoZWRfdmFyaWFudHN8fGUuZVcmJltvKGUpXXx8W2VdfWZ1bmN0aW9uIHMoZSl7ZnVuY3Rpb24gbihlKXtyZXR1cm4gZSYmZS5zb3VyY2V8fGV9ZnVuY3Rpb24gdCh0LHIpe3JldHVybiBuZXcgUmVnRXhwKG4odCksIm0iKyhlLmNJPyJpIjoiIikrKHI/ImciOiIiKSl9ZnVuY3Rpb24gcihhLGkpe2lmKCFhLmNvbXBpbGVkKXtpZihhLmNvbXBpbGVkPSEwLGEuaz1hLmt8fGEuYkssYS5rKXt2YXIgbz17fSx1PWZ1bmN0aW9uKG4sdCl7ZS5jSSYmKHQ9dC50b0xvd2VyQ2FzZSgpKSx0LnNwbGl0KCIgIikuZm9yRWFjaChmdW5jdGlvbihlKXt2YXIgdD1lLnNwbGl0KCJ8Iik7b1t0WzBdXT1bbix0WzFdP051bWJlcih0WzFdKToxXX0pfTsic3RyaW5nIj09dHlwZW9mIGEuaz91KCJrZXl3b3JkIixhLmspOngoYS5rKS5mb3JFYWNoKGZ1bmN0aW9uKGUpe3UoZSxhLmtbZV0pfSksYS5rPW99YS5sUj10KGEubHx8L1x3Ky8sITApLGkmJihhLmJLJiYoYS5iPSJcXGIoIithLmJLLnNwbGl0KCIgIikuam9pbigifCIpKyIpXFxiIiksYS5ifHwoYS5iPS9cQnxcYi8pLGEuYlI9dChhLmIpLGEuZXx8YS5lV3x8KGEuZT0vXEJ8XGIvKSxhLmUmJihhLmVSPXQoYS5lKSksYS50RT1uKGEuZSl8fCIiLGEuZVcmJmkudEUmJihhLnRFKz0oYS5lPyJ8IjoiIikraS50RSkpLGEuaSYmKGEuaVI9dChhLmkpKSxudWxsPT1hLnImJihhLnI9MSksYS5jfHwoYS5jPVtdKSxhLmM9QXJyYXkucHJvdG90eXBlLmNvbmNhdC5hcHBseShbXSxhLmMubWFwKGZ1bmN0aW9uKGUpe3JldHVybiBsKCJzZWxmIj09PWU/YTplKX0pKSxhLmMuZm9yRWFjaChmdW5jdGlvbihlKXtyKGUsYSl9KSxhLnN0YXJ0cyYmcihhLnN0YXJ0cyxpKTt2YXIgYz1hLmMubWFwKGZ1bmN0aW9uKGUpe3JldHVybiBlLmJLPyJcXC4/KCIrZS5iKyIpXFwuPyI6ZS5ifSkuY29uY2F0KFthLnRFLGEuaV0pLm1hcChuKS5maWx0ZXIoQm9vbGVhbik7YS50PWMubGVuZ3RoP3QoYy5qb2luKCJ8IiksITApOntleGVjOmZ1bmN0aW9uKCl7cmV0dXJuIG51bGx9fX19cihlKX1mdW5jdGlvbiBmKGUsdCxhLGkpe2Z1bmN0aW9uIG8oZSxuKXt2YXIgdCxhO2Zvcih0PTAsYT1uLmMubGVuZ3RoO2E+dDt0KyspaWYocihuLmNbdF0uYlIsZSkpcmV0dXJuIG4uY1t0XX1mdW5jdGlvbiB1KGUsbil7aWYocihlLmVSLG4pKXtmb3IoO2UuZW5kc1BhcmVudCYmZS5wYXJlbnQ7KWU9ZS5wYXJlbnQ7cmV0dXJuIGV9cmV0dXJuIGUuZVc/dShlLnBhcmVudCxuKTp2b2lkIDB9ZnVuY3Rpb24gYyhlLG4pe3JldHVybiFhJiZyKG4uaVIsZSl9ZnVuY3Rpb24gbChlLG4pe3ZhciB0PU4uY0k/blswXS50b0xvd2VyQ2FzZSgpOm5bMF07cmV0dXJuIGUuay5oYXNPd25Qcm9wZXJ0eSh0KSYmZS5rW3RdfWZ1bmN0aW9uIHAoZSxuLHQscil7dmFyIGE9cj8iIjpJLmNsYXNzUHJlZml4LGk9JzxzcGFuIGNsYXNzPSInK2Esbz10PyIiOkM7cmV0dXJuIGkrPWUrJyI+JyxpK24rb31mdW5jdGlvbiBoKCl7dmFyIGUsdCxyLGE7aWYoIUUuaylyZXR1cm4gbihrKTtmb3IoYT0iIix0PTAsRS5sUi5sYXN0SW5kZXg9MCxyPUUubFIuZXhlYyhrKTtyOylhKz1uKGsuc3Vic3RyaW5nKHQsci5pbmRleCkpLGU9bChFLHIpLGU/KEIrPWVbMV0sYSs9cChlWzBdLG4oclswXSkpKTphKz1uKHJbMF0pLHQ9RS5sUi5sYXN0SW5kZXgscj1FLmxSLmV4ZWMoayk7cmV0dXJuIGErbihrLnN1YnN0cih0KSl9ZnVuY3Rpb24gZCgpe3ZhciBlPSJzdHJpbmciPT10eXBlb2YgRS5zTDtpZihlJiYheVtFLnNMXSlyZXR1cm4gbihrKTt2YXIgdD1lP2YoRS5zTCxLine truncated
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
code{white-space: pre-wrap;}
|
||||||
|
span.smallcaps{font-variant: small-caps;}
|
||||||
|
span.underline{text-decoration: underline;}
|
||||||
|
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||||
|
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
|
||||||
|
ul.task-list{list-style: none;}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style type="text/css">code{white-space: pre;}</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
if (window.hljs) {
|
||||||
|
hljs.configure({languages: []});
|
||||||
|
hljs.initHighlightingOnLoad();
|
||||||
|
if (document.readyState && document.readyState === "complete") {
|
||||||
|
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.main-container {
|
||||||
|
max-width: 940px;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
max-width:100%;
|
||||||
|
}
|
||||||
|
.tabbed-pane {
|
||||||
|
padding-top: 12px;
|
||||||
|
}
|
||||||
|
.html-widget {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
button.code-folding-btn:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
summary {
|
||||||
|
display: list-item;
|
||||||
|
}
|
||||||
|
details > summary > p:only-child {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
pre code {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- tabsets -->
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.tabset-dropdown > .nav-tabs {
|
||||||
|
display: inline-table;
|
||||||
|
max-height: 500px;
|
||||||
|
min-height: 44px;
|
||||||
|
overflow-y: auto;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs > li.active:before, .tabset-dropdown > .nav-tabs.nav-tabs-open:before {
|
||||||
|
content: "\e259";
|
||||||
|
font-family: 'Glyphicons Halflings';
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px;
|
||||||
|
border-right: 1px solid #ddd;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
|
||||||
|
content: "\e258";
|
||||||
|
font-family: 'Glyphicons Halflings';
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs > li.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs > li > a,
|
||||||
|
.tabset-dropdown > .nav-tabs > li > a:focus,
|
||||||
|
.tabset-dropdown > .nav-tabs > li > a:hover {
|
||||||
|
border: none;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
|
||||||
|
display: block;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
.tabset-dropdown > .nav-tabs > li {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<!-- code folding -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="container-fluid main-container">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div id="header">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<h1 class="title toc-ignore">Generating antibiograms with the AMR
|
||||||
|
package</h1>
|
||||||
|
<h4 class="author">AMR package developers</h4>
|
||||||
|
<h4 class="date">2023-02-08</h4>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<p>This is an example R Markdown file to show the use of
|
||||||
|
<code>antibiogram()</code> of the AMR package.</p>
|
||||||
|
<p>For starters, this is what our <code>example_isolates</code> data set
|
||||||
|
looks like:</p>
|
||||||
|
<pre class="r"><code>example_isolates</code></pre>
|
||||||
|
<pre><code>## # A tibble: 2,000 × 46
|
||||||
|
## date patient age gender ward mo PEN OXA FLC AMX
|
||||||
|
## <date> <chr> <dbl> <chr> <chr> <mo> <sir> <sir> <sir> <sir>
|
||||||
|
## 1 2002-01-02 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
|
||||||
|
## 2 2002-01-03 A77334 65 F Clinical B_ESCHR_COLI R NA NA NA
|
||||||
|
## 3 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
|
||||||
|
## 4 2002-01-07 067927 45 F ICU B_STPHY_EPDR R NA R NA
|
||||||
|
## 5 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
|
||||||
|
## 6 2002-01-13 067927 45 F ICU B_STPHY_EPDR R NA R NA
|
||||||
|
## 7 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
|
||||||
|
## 8 2002-01-14 462729 78 M Clinical B_STPHY_AURS R NA S R
|
||||||
|
## 9 2002-01-16 067927 45 F ICU B_STPHY_EPDR R NA R NA
|
||||||
|
## 10 2002-01-17 858515 79 F ICU B_STPHY_EPDR R NA S NA
|
||||||
|
## # … with 1,990 more rows, and 36 more variables: AMC <sir>, AMP <sir>,
|
||||||
|
## # TZP <sir>, CZO <sir>, FEP <sir>, CXM <sir>, FOX <sir>, CTX <sir>,
|
||||||
|
## # CAZ <sir>, CRO <sir>, GEN <sir>, TOB <sir>, AMK <sir>, KAN <sir>,
|
||||||
|
## # TMP <sir>, SXT <sir>, NIT <sir>, FOS <sir>, LNZ <sir>, CIP <sir>,
|
||||||
|
## # MFX <sir>, VAN <sir>, TEC <sir>, TCY <sir>, TGC <sir>, DOX <sir>,
|
||||||
|
## # ERY <sir>, CLI <sir>, AZM <sir>, IPM <sir>, MEM <sir>, MTR <sir>,
|
||||||
|
## # CHL <sir>, COL <sir>, MUP <sir>, RIF <sir></code></pre>
|
||||||
|
<div id="traditional-antibiogram" class="section level3">
|
||||||
|
<h3>Traditional Antibiogram</h3>
|
||||||
|
<pre class="r"><code>print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c(aminoglycosides(), carbapenems()))
|
||||||
|
)</code></pre>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr class="header">
|
||||||
|
<th align="left">Pathogen (N min-max)</th>
|
||||||
|
<th align="right">AMK</th>
|
||||||
|
<th align="right">GEN</th>
|
||||||
|
<th align="right">IPM</th>
|
||||||
|
<th align="right">KAN</th>
|
||||||
|
<th align="right">MEM</th>
|
||||||
|
<th align="right">TOB</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">CoNS (43-309)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">86</td>
|
||||||
|
<td align="right">52</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">52</td>
|
||||||
|
<td align="right">22</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">E. coli (0-462)</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">97</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">E. faecalis (0-39)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">K. pneumoniae (0-58)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">90</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">90</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">P. aeruginosa (17-30)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">P. mirabilis (0-34)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">94</td>
|
||||||
|
<td align="right">94</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">94</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">S. aureus (2-233)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">99</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">S. epidermidis (8-163)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">79</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">51</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">S. hominis (3-80)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">92</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">85</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">S. pneumoniae (11-117)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="combined-antibiogram" class="section level3">
|
||||||
|
<h3>Combined Antibiogram</h3>
|
||||||
|
<pre class="r"><code>print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c("TZP", "TZP+TOB", "TZP+GEN"))
|
||||||
|
)</code></pre>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr class="header">
|
||||||
|
<th align="left">Pathogen (N min-max)</th>
|
||||||
|
<th align="right">TZP</th>
|
||||||
|
<th align="right">TZP + GEN</th>
|
||||||
|
<th align="right">TZP + TOB</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">CoNS (29-274)</td>
|
||||||
|
<td align="right">30</td>
|
||||||
|
<td align="right">97</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">E. coli (416-461)</td>
|
||||||
|
<td align="right">94</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">99</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">K. pneumoniae (53-58)</td>
|
||||||
|
<td align="right">89</td>
|
||||||
|
<td align="right">93</td>
|
||||||
|
<td align="right">93</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">P. aeruginosa (27-30)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">P. mirabilis (27-34)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">S. aureus (7-231)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">S. epidermidis (5-128)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">S. hominis (0-74)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">S. pneumoniae (112-112)</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="syndromic-antibiogram" class="section level3">
|
||||||
|
<h3>Syndromic Antibiogram</h3>
|
||||||
|
<pre class="r"><code>print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c(aminoglycosides(), carbapenems()),
|
||||||
|
syndromic_group = "ward")
|
||||||
|
)</code></pre>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr class="header">
|
||||||
|
<th align="left">Syndromic Group</th>
|
||||||
|
<th align="left">Pathogen (N min-max)</th>
|
||||||
|
<th align="right">AMK</th>
|
||||||
|
<th align="right">GEN</th>
|
||||||
|
<th align="right">IPM</th>
|
||||||
|
<th align="right">KAN</th>
|
||||||
|
<th align="right">MEM</th>
|
||||||
|
<th align="right">TOB</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">CoNS (23-205)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">89</td>
|
||||||
|
<td align="right">57</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">57</td>
|
||||||
|
<td align="right">26</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">ICU</td>
|
||||||
|
<td align="left">CoNS (10-73)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">79</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">Outpatient</td>
|
||||||
|
<td align="left">CoNS (3-31)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">84</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">E. coli (0-299)</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">ICU</td>
|
||||||
|
<td align="left">E. coli (0-137)</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">99</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">96</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">K. pneumoniae (0-51)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">92</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">92</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">P. mirabilis (0-30)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">S. aureus (2-150)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">99</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">97</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">ICU</td>
|
||||||
|
<td align="left">S. aureus (0-66)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">100</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">S. epidermidis (4-79)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">82</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">55</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">ICU</td>
|
||||||
|
<td align="left">S. epidermidis (4-75)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">72</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">41</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">S. hominis (1-45)</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">96</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">94</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">Clinical</td>
|
||||||
|
<td align="left">S. pneumoniae (5-78)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">ICU</td>
|
||||||
|
<td align="left">S. pneumoniae (5-30)</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
<td align="right">NA</td>
|
||||||
|
<td align="right">0</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div id="weighted-incidence-syndromic-combination-antibiogram-wisca" class="section level3">
|
||||||
|
<h3>Weighted-Incidence Syndromic Combination Antibiogram (WISCA)</h3>
|
||||||
|
<pre class="r"><code>print(
|
||||||
|
antibiogram(example_isolates,
|
||||||
|
antibiotics = c("AMC", "AMC+CIP", "TZP", "TZP+TOB"),
|
||||||
|
mo_transform = "gramstain",
|
||||||
|
minimum = 10, # this should be >= 30, but now just as example
|
||||||
|
syndromic_group = ifelse(example_isolates$age >= 65 &
|
||||||
|
example_isolates$gender == "M",
|
||||||
|
"WISCA Group 1", "WISCA Group 2"))
|
||||||
|
)</code></pre>
|
||||||
|
<table>
|
||||||
|
<colgroup>
|
||||||
|
<col width="23%" />
|
||||||
|
<col width="35%" />
|
||||||
|
<col width="5%" />
|
||||||
|
<col width="14%" />
|
||||||
|
<col width="5%" />
|
||||||
|
<col width="14%" />
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr class="header">
|
||||||
|
<th align="left">Syndromic Group</th>
|
||||||
|
<th align="left">Pathogen (N min-max)</th>
|
||||||
|
<th align="right">AMC</th>
|
||||||
|
<th align="right">AMC + CIP</th>
|
||||||
|
<th align="right">TZP</th>
|
||||||
|
<th align="right">TZP + TOB</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">WISCA Group 1</td>
|
||||||
|
<td align="left">Gram-negative (261-285)</td>
|
||||||
|
<td align="right">76</td>
|
||||||
|
<td align="right">95</td>
|
||||||
|
<td align="right">89</td>
|
||||||
|
<td align="right">99</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">WISCA Group 2</td>
|
||||||
|
<td align="left">Gram-negative (380-442)</td>
|
||||||
|
<td align="right">76</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
<td align="right">88</td>
|
||||||
|
<td align="right">98</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="odd">
|
||||||
|
<td align="left">WISCA Group 1</td>
|
||||||
|
<td align="left">Gram-positive (123-406)</td>
|
||||||
|
<td align="right">76</td>
|
||||||
|
<td align="right">89</td>
|
||||||
|
<td align="right">81</td>
|
||||||
|
<td align="right">95</td>
|
||||||
|
</tr>
|
||||||
|
<tr class="even">
|
||||||
|
<td align="left">WISCA Group 2</td>
|
||||||
|
<td align="left">Gram-positive (222-732)</td>
|
||||||
|
<td align="right">76</td>
|
||||||
|
<td align="right">89</td>
|
||||||
|
<td align="right">88</td>
|
||||||
|
<td align="right">95</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
// add bootstrap table styles to pandoc tables
|
||||||
|
function bootstrapStylePandocTables() {
|
||||||
|
$('tr.odd').parent('tbody').parent('table').addClass('table table-condensed');
|
||||||
|
}
|
||||||
|
$(document).ready(function () {
|
||||||
|
bootstrapStylePandocTables();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- tabsets -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function () {
|
||||||
|
window.buildTabsets("TOC");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$('.tabset-dropdown > .nav-tabs > li').click(function () {
|
||||||
|
$(this).parent().toggleClass('nav-tabs-open');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- code folding -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- dynamically load mathjax for compatibility with self-contained -->
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var script = document.createElement("script");
|
||||||
|
script.type = "text/javascript";
|
||||||
|
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
|
||||||
|
document.getElementsByTagName("head")[0].appendChild(script);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -32,11 +32,11 @@
|
|||||||
# Source file: data-raw/reproduction_of_poorman.R
|
# Source file: data-raw/reproduction_of_poorman.R
|
||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
|
|
||||||
# poorman: a package to replace all dplyr functions with base R so we can lose dependency on dplyr.
|
# {poorman}: a package to replace all dplyr functions with base R so we can lose dependency on {dplyr}.
|
||||||
# These functions were downloaded from https://github.com/nathaneastwood/poorman,
|
# These functions were downloaded from https://github.com/nathaneastwood/poorman,
|
||||||
# from this commit: https://github.com/nathaneastwood/poorman/tree/{commit}.
|
# from this commit: https://github.com/nathaneastwood/poorman/tree/{commit}.
|
||||||
#
|
#
|
||||||
# All functions are prefixed with 'pm_' to make it obvious that they are dplyr substitutes.
|
# All functions are prefixed with 'pm_' to make it obvious that they are {dplyr} substitutes.
|
||||||
#
|
#
|
||||||
# All code below was released under MIT license, that permits 'free of charge, to any person obtaining a
|
# All code below was released under MIT license, that permits 'free of charge, to any person obtaining a
|
||||||
# copy of the software and associated documentation files (the "Software"), to deal in the Software
|
# copy of the software and associated documentation files (the "Software"), to deal in the Software
|
||||||
|
|||||||
@@ -1,22 +1,28 @@
|
|||||||
# get complete filenames of all R files in the GitHub repository of nathaneastwood/poorman
|
# get complete filenames of all R files in the GitHub repository of nathaneastwood/poorman
|
||||||
|
|
||||||
commit <- "52eb6947e0b4430cd588976ed8820013eddf955f"
|
library(magrittr)
|
||||||
|
commit <- "3cc0a9920b1eb559dd166f548561244189586b3a"
|
||||||
|
|
||||||
files <- xml2::read_html(paste0("https://github.com/nathaneastwood/poorman/tree/", commit, "/R")) %>%
|
files <- xml2::read_html(paste0("https://github.com/nathaneastwood/poorman/tree/", commit, "/R")) %>%
|
||||||
rvest::html_nodes("a") %>%
|
rvest::html_nodes("a") %>%
|
||||||
rvest::html_attr("href")
|
rvest::html_attr("href")
|
||||||
|
files <- files[files %like% "/blob/.*R$"]
|
||||||
|
|
||||||
# get full URLs of all raw R files
|
# get full URLs of all raw R files
|
||||||
files <- sort(paste0("https://raw.githubusercontent.com", gsub("blob/", "", files[files %like% "/R/.*.R$"])))
|
files <- sort(paste0("https://raw.githubusercontent.com", gsub("blob/", "", files[files %like% "/R/.*.R$"])))
|
||||||
# remove files with only pkg specific code
|
# remove files with only pkg specific code
|
||||||
files <- files[files %unlike% "(zzz|init)[.]R$"]
|
files <- files[files %unlike% "(zzz|init)[.]R$"]
|
||||||
# also, there's a lot of functions we don't use
|
# also, there's a lot of functions we don't use
|
||||||
files <- files[files %unlike% "(slice|glimpse|recode|replace_na|coalesce)[.]R$"]
|
files <- files[files %unlike% "/(between|coalesce|cumulative|fill|glimpse|gluestick|group_cols|na_if|near|nest_by|poorman-package|print|recode|reconstruct|replace_na|replace_with|rownames|slice|union_all|unite|window_rank|with_groups)[.]R$"]
|
||||||
|
|
||||||
# add our prepend file, containing info about the source of the data
|
# add our prepend file, containing info about the source of the data
|
||||||
intro <- readLines("data-raw/poorman_prepend.R")
|
intro <- readLines("data-raw/poorman_prepend.R") %>%
|
||||||
|
# add commit to intro part
|
||||||
|
gsub("{commit}", commit, ., fixed = TRUE) %>%
|
||||||
|
# add date to intro part
|
||||||
|
gsub("{date}", trimws(format(Sys.Date(), "%e %B %Y")), ., fixed = TRUE)
|
||||||
# copyright info:
|
# copyright info:
|
||||||
copyright <- paste0("# ", readLines("https://raw.githubusercontent.com/nathaneastwood/poorman/master/LICENSE"))
|
copyright <- paste0("# ", readLines(paste0("https://raw.githubusercontent.com/nathaneastwood/poorman/", commit, "/LICENSE")))
|
||||||
|
|
||||||
# read all contents to a character vector
|
# read all contents to a character vector
|
||||||
contents <- character(0)
|
contents <- character(0)
|
||||||
@@ -25,31 +31,35 @@ sapply(files, function(file) {
|
|||||||
contents <<- c(contents, readLines(file))
|
contents <<- c(contents, readLines(file))
|
||||||
invisible()
|
invisible()
|
||||||
})
|
})
|
||||||
contents <- c(
|
|
||||||
intro,
|
|
||||||
copyright,
|
|
||||||
"",
|
|
||||||
contents
|
|
||||||
)
|
|
||||||
|
|
||||||
# remove lines starting with "#'" and NULL and write to file
|
# remove lines starting with "#'" and NULL and write to file
|
||||||
contents <- contents[!grepl("^(#'|NULL|\"_PACKAGE)", contents)]
|
contents <- contents[!grepl("^(#'|NULL|\"_PACKAGE)", contents)]
|
||||||
|
contents.bak <- contents
|
||||||
|
|
||||||
|
# grouped attributes same as dplyr
|
||||||
|
contents <- gsub("grouped_data", "grouped_df", contents, fixed = TRUE)
|
||||||
# now make it independent on UseMethod, since we will not export these functions
|
# now make it independent on UseMethod, since we will not export these functions
|
||||||
contents <- gsub('UseMethod[(]"(.*?)"[)]',
|
has_usemethods <- gsub("^([a-z_]+).*", "\\1", contents[which(contents %like% "usemethod") - 1])
|
||||||
'if ("grouped_data" %in% class(.data)) {||| \\1.grouped_data(.data, ...)||| } else {||| \\1.default(.data, ...)||| }',
|
for (use in has_usemethods) {
|
||||||
paste(contents, collapse = "|||"),
|
relevant_row <- which(contents %like% paste0("^", use, " <- function")) + 1
|
||||||
perl = TRUE
|
function_call <- trimws(gsub(".*function(.*)\\{.*", "\\1", contents[relevant_row - 1]))
|
||||||
) %>%
|
function_call1 <- trimws(gsub("[()]", "", strsplit(function_call, ",")[[1]][1]))
|
||||||
# add commit to intro part
|
if (any(contents %like% paste0(use, ".grouped_df"))) {
|
||||||
gsub("{commit}", commit, ., fixed = TRUE) %>%
|
# this function will have methods for data.frame and grouped_df
|
||||||
# add date to intro part
|
contents[relevant_row] <- paste0(" if (\"grouped_df\" %in% class(", function_call1, ")) ", use, ".grouped_df", function_call, " else ", use, ".data.frame", function_call)
|
||||||
gsub("{date}", format(Sys.Date(), "%e %B %Y"), ., fixed = TRUE) %>%
|
} else {
|
||||||
strsplit(split = "|||", fixed = TRUE) %>%
|
# this function will only have data.frame as method
|
||||||
unlist() %>%
|
contents[relevant_row] <- paste0(" ", use, ".data.frame", function_call)
|
||||||
# add "pm_" as prefix to all functions
|
}
|
||||||
gsub("^([a-z_.]+) <- function", "pm_\\1 <- function", .)
|
# add pm_ prefix
|
||||||
|
contents[relevant_row - 1] <- paste0("pm_", contents[relevant_row - 1])
|
||||||
|
|
||||||
|
}
|
||||||
|
# correct for NextMethod
|
||||||
|
contents <- gsub("NextMethod\\(\"(.*)\"\\)", "\\1.data.frame(...)", contents)
|
||||||
|
# correct for 'default' method
|
||||||
|
contents <- gsub(".default <-", ".data.frame <-", contents, fixed = TRUE)
|
||||||
|
contents <- gsub("pm_group_by_drop.data.frame", "pm_group_by_drop", contents, fixed = TRUE)
|
||||||
# now get all those pm_* functions to replace all untransformed function name calls as well
|
# now get all those pm_* functions to replace all untransformed function name calls as well
|
||||||
new_pm_names <- sort(gsub("pm_(.*?) <-.*", "\\1", contents[grepl("^pm_", contents)]))
|
new_pm_names <- sort(gsub("pm_(.*?) <-.*", "\\1", contents[grepl("^pm_", contents)]))
|
||||||
for (i in seq_len(length(new_pm_names))) {
|
for (i in seq_len(length(new_pm_names))) {
|
||||||
@@ -57,29 +67,39 @@ for (i in seq_len(length(new_pm_names))) {
|
|||||||
# starting with a space or a straight bracket or an opening parenthesis, ending with nothing or a non-character or a closing parenthesis
|
# starting with a space or a straight bracket or an opening parenthesis, ending with nothing or a non-character or a closing parenthesis
|
||||||
contents <- gsub(paste0("( |\\[|\\()", new_pm_names[i], "($|[^a-z]|\\))"), paste0("\\1pm_", new_pm_names[i], "\\2"), contents)
|
contents <- gsub(paste0("( |\\[|\\()", new_pm_names[i], "($|[^a-z]|\\))"), paste0("\\1pm_", new_pm_names[i], "\\2"), contents)
|
||||||
}
|
}
|
||||||
|
|
||||||
# replace %>% with %pm>%
|
# replace %>% with %pm>%
|
||||||
|
contents[which(contents %like% "^\\|\\|") - 1] <- paste0(contents[which(contents %like% "^\\|\\|") - 1], " ||")
|
||||||
|
contents[which(contents %like% "^\\|\\|")] <- gsub("^\\|\\|", "", contents[which(contents %like% "^\\|\\|")])
|
||||||
contents <- gsub("%>%", "%pm>%", contents, fixed = TRUE)
|
contents <- gsub("%>%", "%pm>%", contents, fixed = TRUE)
|
||||||
# fix for new lines, since n() also existed
|
# fix for new lines, since n() also existed
|
||||||
contents <- gsub("\\pm_n", "\\n", contents, fixed = TRUE)
|
contents <- gsub("\\pm_n", "\\n", contents, fixed = TRUE)
|
||||||
# prefix other functions also with "pm_"
|
# prefix other functions also with "pm_"
|
||||||
contents <- gsub("^([a-z_]+)(\\$|)", "pm_\\1\\2", contents)
|
contents <- gsub("^([a-z_]+)(\\$|)", "pm_\\1\\2", contents)
|
||||||
# prefix environments
|
# prefix environmental objects and functions
|
||||||
contents <- gsub("eval_env", "pm_eval_env", contents, fixed = TRUE)
|
contents <- gsub("(eval_env|select_env|select_context|context|dotdotdot|as_symbols|insert_dot|deparse_|groups_set|apply_grouped_function|split_into_groups|calculate_groups|has_groups|eval_select_pos|select_positions|eval_expr|eval_call|add_group_columns|find_used|is_nested|setup_|select_|group_)", "pm_\\1", contents)
|
||||||
contents <- gsub("select_env", "pm_select_env", contents, fixed = TRUE)
|
|
||||||
contents <- gsub("context", "pm_context", contents, fixed = TRUE)
|
|
||||||
# now some items are overprefixed
|
# now some items are overprefixed
|
||||||
contents <- gsub("(pm_)+", "pm_", contents)
|
contents <- gsub("(pm_)+", "pm_", contents)
|
||||||
# special case for pm_distinct(), we need '.keep_all' to work
|
contents <- gsub("pm_if (\"grouped_df", "if (\"grouped_df", contents, fixed = TRUE)
|
||||||
contents <- gsub("pm_distinct <- function(.data, ..., .keep_all = FALSE)", "pm_distinct <- function(.data, ...)", contents, fixed = TRUE)
|
# remove comments and empty lines
|
||||||
# pm_pull does not correct for tibbles, misses the drop argument
|
contents <- gsub("#.*", "", contents)
|
||||||
contents[contents == ".data[, var]"] <- ".data[, var, drop = TRUE]"
|
contents <- contents[trimws(contents) != ""]
|
||||||
|
# fix for their relocate()
|
||||||
|
contents <- gsub("if (!missing(.before))", "if (!missing(.before) && !is.null(.before))", contents, fixed = TRUE)
|
||||||
|
contents <- gsub("if (!missing(.after))", "if (!missing(.after) && !is.null(.after))", contents, fixed = TRUE)
|
||||||
|
contents[which(contents %like% "reshape\\($") + 1] <- gsub("data", "as.data.frame(data, stringsAsFactors = FALSE)", contents[which(contents %like% "reshape\\($") + 1])
|
||||||
|
contents <- gsub('pm_relocate(.data = long, values_to, .after = -1)', 'pm_relocate(.data = long, "value", .after = -1)', contents, fixed = TRUE)
|
||||||
|
|
||||||
# who needs US spelling?
|
# who needs US spelling?
|
||||||
contents <- contents[!grepl("summarize", contents)]
|
contents <- contents[contents %unlike% "summarize"]
|
||||||
|
|
||||||
|
# add intro
|
||||||
|
contents <- c(
|
||||||
|
intro,
|
||||||
|
copyright,
|
||||||
|
"",
|
||||||
|
contents
|
||||||
|
)
|
||||||
|
|
||||||
writeLines(contents, "R/aa_helper_pm_functions.R")
|
writeLines(contents, "R/aa_helper_pm_functions.R")
|
||||||
|
|
||||||
# after this, comment out:
|
# note: pm_left_join() will be overwritten by aaa_helper_functions.R, which contains a faster implementation
|
||||||
# pm_left_join() since we use a faster version
|
|
||||||
# pm_group_split() since we don't use it and it relies on R 3.5.0 for the use of ...length(), which is hard to support without C++ code
|
|
||||||
@@ -68,7 +68,6 @@ import_functions <- c(
|
|||||||
"read_html" = "xml2",
|
"read_html" = "xml2",
|
||||||
"rename" = "dplyr",
|
"rename" = "dplyr",
|
||||||
"right_join" = "dplyr",
|
"right_join" = "dplyr",
|
||||||
"row_number" = "dplyr",
|
|
||||||
"select" = "dplyr",
|
"select" = "dplyr",
|
||||||
"semi_join" = "dplyr",
|
"semi_join" = "dplyr",
|
||||||
"showQuestion" = "rstudioapi",
|
"showQuestion" = "rstudioapi",
|
||||||
|
|||||||
+2
-4
@@ -40,11 +40,9 @@ if (tryCatch(isTRUE(AMR:::import_fn("isJob", "rstudioapi")()), error = function(
|
|||||||
if (AMR:::pkg_is_available("tinytest", also_load = TRUE)) {
|
if (AMR:::pkg_is_available("tinytest", also_load = TRUE)) {
|
||||||
library(AMR)
|
library(AMR)
|
||||||
if (identical(AMR:::import_fn("select", "dplyr"), AMR:::select)) {
|
if (identical(AMR:::import_fn("select", "dplyr"), AMR:::select)) {
|
||||||
print("This test will rely on {dplyr} verbs")
|
message("\n\n------------------------------------\nThis test will rely on {dplyr} verbs\n------------------------------------\n\n")
|
||||||
message("This test will rely on {dplyr} verbs")
|
|
||||||
} else {
|
} else {
|
||||||
print("This test will rely on {poorman} verbs")
|
message("\n\n---------------------------------------------------------------------\nThis test will rely on {poorman} verbs (installed state dplyr: ", AMR:::pkg_is_available("dplyr", also_load = FALSE), ")\n---------------------------------------------------------------------\n\n")
|
||||||
message("This test will rely on {poorman} verbs")
|
|
||||||
}
|
}
|
||||||
# set language
|
# set language
|
||||||
set_AMR_locale("English")
|
set_AMR_locale("English")
|
||||||
|
|||||||
Reference in new issue
Block a user