Last updated: 2022-11-30

Checks: 7 0

Knit directory: ampel-leipzig-meld/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20210604) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version e1aebf7. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    _targets/
    Ignored:    analysis/article.md
    Ignored:    container/
    Ignored:    logs/
    Ignored:    scripts/R.sh

Untracked files:
    Untracked:  analysis/bibliography/bibliography.bib.sav.tmp
    Untracked:  submission/

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


These are the previous versions of the repository in which changes were made to the R Markdown (analysis/linecharts.Rmd) and HTML (docs/linecharts.html) files. If you’ve configured a remote Git repository (see ?wflow_git_remote), click on the hyperlinks in the table below to view the files as they were in that past version.

File Version Author Date Message
html 65d58c4 Sebastian Gibb 2022-07-18 chore: rebuild site
html fb43d01 Sebastian Gibb 2022-06-19 chore: rebuild site
html ebe29cf Sebastian Gibb 2022-06-16 chore: rebuild site
html 8035219 Sebastian Gibb 2022-06-15 chore: rebuild site
html d3e9462 Sebastian Gibb 2022-06-06 chore: rebuild site
html b20484a Sebastian Gibb 2022-06-06 chore: rebuild site
html 983ec69 Sebastian Gibb 2022-03-17 chore: rebuild site
html 373e7d8 Sebastian Gibb 2021-10-20 chore: rebuild site
html df8964f Sebastian Gibb 2021-10-15 chore: rebuild site
html c66640c Sebastian Gibb 2021-09-14 feat: first nnet tests
html afa48d9 Sebastian Gibb 2021-08-07 chore: rebuild site
Rmd 4478f6a Sebastian Gibb 2021-08-02 Revert "fix: working directory for targets"
Rmd cac14f6 Sebastian Gibb 2021-08-02 fix: working directory for targets
Rmd 3957af7 Sebastian Gibb 2021-08-02 refactor: move common yaml headers into _site.yml
html 3aab3e1 Sebastian Gibb 2021-08-01 chore: rebuild site
html 3810a79 Sebastian Gibb 2021-07-15 chore: rebuild site
html 13b68ca Sebastian Gibb 2021-07-04 chore: rebuild site
html 2869556 Sebastian Gibb 2021-07-02 chore: rebuild site
html d9c37ec Sebastian Gibb 2021-07-02 chore: rebuild site
Rmd 0cdb21d Sebastian Gibb 2021-07-02 feat: add plot MeldCategory vs mean std values
html 81fcc75 Sebastian Gibb 2021-06-11 chore: rebuild site
Rmd 4ac1449 Sebastian Gibb 2021-06-11 feat: add linecharts report

library("targets")
tar_load(zlog_data)

1 Compare Mean Zlog Values vs Status

labv <- sort(grep("_[SECQ]$", colnames(zlog_data), value = TRUE))

## divide data.frame by dead/alive
s <- split(zlog_data[labv], zlog_data$Deceased)
names(s) <- c("survived", "dead")

## calculate mean standardized lab values
s <- lapply(s, colMeans, na.rm = TRUE)
o <- order(s$dead)

## comparison plot
col <- palette.colors(2L)

## keep old graphic parameters and restore them afterwards
old.par <- par(no.readonly = TRUE)

par(mar = c(7.1, 4.1, 4.1, 2.1), cex = 0.5)

plot(
    s$dead[o], type = "b", pch = 20, lwd = 2, col = col[1],
    axes = FALSE, ann = FALSE
)
lines(s$survived[o], type = "b", pch = 20, lwd = 2, col = col[2])
legend(
    "bottomright",
    legend = c("dead", "survived"),
    col = col, lwd = 2, pch = 20, bty = "n"
)
title(
    main = "Mortality Status vs Mean Standardized Laboratory Values", adj = 0
)
title(xlab = "Laboratory Measurements", adj = 1L, line = 5)
title(ylab = "Mean Standardized Values", adj = 1L)
r <- range(unlist(s))
axis(
    2, at = seq(from = floor(r[1]), to = ceiling(r[2])),
    lwd.ticks = 0, col = "#808080"
)
axis(
    1, at = seq_along(o), labels = names(s$dead[o]), las = 2,
    lwd.ticks = 0L, col = "#808080"
)

Version Author Date
ebe29cf Sebastian Gibb 2022-06-16
8035219 Sebastian Gibb 2022-06-15
3810a79 Sebastian Gibb 2021-07-15
d9c37ec Sebastian Gibb 2021-07-02
par(old.par)

2 Compare Mean Zlog Values vs MeldCategory

## divide data.frame by MELD
s <- split(zlog_data[labv], zlog_data$MeldCategory)

## calculate mean standardized lab values
s <- lapply(s, colMeans, na.rm = TRUE)
n <- length(s)
o <- order(s[[n]])

## comparison plot
col <- rev(palette.colors(n))

## keep old graphic parameters and restore them afterwards
old.par <- par(no.readonly = TRUE)

par(mar = c(7.1, 4.1, 4.1, 2.1), cex = 0.5)

plot(
    s[[n]][o], type = "b", pch = 20, lwd = 2, col = col[n],
    axes = FALSE, ann = FALSE
)
for (i in seq_len(n - 1)) {
    lines(s[[i]][o], type = "b", pch = 20, lwd = 2, col = col[i])
}
legend(
    "bottomright",
    legend = names(s),
    col = col, lwd = 2, pch = 20, bty = "n"
)
title(
    main = "MELD Category vs Mean Standardized Laboratory Values", adj = 0
)
title(xlab = "Laboratory Measurements", adj = 1L, line = 5)
title(ylab = "Mean Standardized Values", adj = 1L)
r <- range(unlist(s))
axis(
    2, at = seq(from = floor(r[1]), to = ceiling(r[2])),
    lwd.ticks = 0, col = "#808080"
)
axis(
    1, at = seq_along(o), labels = names(s[[n]][o]), las = 2,
    lwd.ticks = 0L, col = "#808080"
)
abline(h = 0, col = "#808080", lty = 2)

Version Author Date
ebe29cf Sebastian Gibb 2022-06-16
8035219 Sebastian Gibb 2022-06-15
afa48d9 Sebastian Gibb 2021-08-07
3810a79 Sebastian Gibb 2021-07-15
13b68ca Sebastian Gibb 2021-07-04
d9c37ec Sebastian Gibb 2021-07-02
par(old.par)

sessionInfo()
R version 4.2.0 (2022-04-22)
Platform: x86_64-unknown-linux-gnu (64-bit)

Matrix products: default
BLAS/LAPACK: /gnu/store/ras6dprsw3wm3swk23jjp8ww5dwxj333-openblas-0.3.18/lib/libopenblasp-r0.3.18.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] targets_0.12.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.8.3      highr_0.9         pillar_1.7.0      compiler_4.2.0   
 [5] bslib_0.3.1       later_1.3.0       jquerylib_0.1.4   git2r_0.30.1     
 [9] workflowr_1.7.0   tools_4.2.0       digest_0.6.29     jsonlite_1.8.0   
[13] evaluate_0.15     lifecycle_1.0.1   tibble_3.1.7      pkgconfig_2.0.3  
[17] rlang_1.0.2       igraph_1.3.1      cli_3.3.0         yaml_2.3.5       
[21] xfun_0.31         fastmap_1.1.0     withr_2.5.0       stringr_1.4.0    
[25] knitr_1.39        fs_1.5.2          vctrs_0.4.1       sass_0.4.1       
[29] tidyselect_1.1.2  rprojroot_2.0.3   data.table_1.14.2 glue_1.6.2       
[33] R6_2.5.1          processx_3.5.3    fansi_1.0.3       base64url_1.4    
[37] rmarkdown_2.14    bookdown_0.26     purrr_0.3.4       callr_3.7.0      
[41] magrittr_2.0.3    whisker_0.4       codetools_0.2-18  ps_1.7.0         
[45] backports_1.4.1   promises_1.2.0.1  ellipsis_0.3.2    htmltools_0.5.2  
[49] httpuv_1.6.5      utf8_1.2.2        stringi_1.7.6     crayon_1.5.1