The goal of visR is to enable fit-for-purpose, reusable clinical and medical research focused visualizations and tables with sensible defaults and based on sound graphical principles.
By using a common package for visualising data analysis results in the clinical development process, we want to have a positive influence on
- choice of visualisation by making it easy explore different visualisation and to use impactful visualisations fit-for-purpose
- effective visual communication by making it easy to implement best practices
We are not judging on what visualisation you chose for your research question, but want to facilitate and support good practice.
You can read more about the philosophy and architecture in the repo wiki.
The package is still experimental and under active development with a current focus on developing a stable API.
Badge | Description |
---|---|
Development stage | |
Unit testing coverage - on main |
|
main branch |
|
Documentation building to Github pages | |
Latest CRAN release | |
riskmetric score |
The easiest way to get visR
is to install from CRAN:
install.packages("visR")
Install the development version from GitHub with:
# defaults to develop branch
devtools::install_github("openpharma/visR")
Install the latest stable version from GitHub with:
devtools::install_github("openpharma/visR", ref = "main")
This is a basic example to demonstrate how the API can be used to add layers to a visualization. In this example a time to event analysis. The example calculates stratified Kaplan-Meier by treatment and then plots. Additional functions can be used to add uncertainty intervals, censoring information and a risk table.
library(visR)
library(ggplot2)
theme_set(theme_minimal())
adtte %>%
estimate_KM(strata = "TRTP", conf.int = 0.90) %>%
visr(legend_position = "right", x_unit = "Days") %>%
add_CI(style = "ribbon") %>%
add_CNSR(shape = 3, size = 1) %>%
add_risktable(
statlist = c("n.risk", "n.event", "n.censor"),
label = c("At risk", "Event", "Censor")
)
Please note that the visR
project is released with a Contributor Code
of Conduct. By contributing to this project, you
agree to abide by its terms.
Last time readme built.
covr::package_coverage(type = "none", code = "tools::testInstalledPackage(pkg = 'visR', types = c('tests'))", quiet = FALSE)
#> visR Coverage: 99.93%
#> R/visr.R: 99.51%
#> R/add_annotation.R: 100.00%
#> R/add_CI.R: 100.00%
#> R/add_CNSR.R: 100.00%
#> R/add_highlight.R: 100.00%
#> R/add_quantiles.R: 100.00%
#> R/add_risktable.R: 100.00%
#> R/apply_attrition.R: 100.00%
#> R/apply_theme.R: 100.00%
#> R/estimate_KM.R: 100.00%
#> R/get_attrition.R: 100.00%
#> R/get_COX_HR.R: 100.00%
#> R/get_pvalue.R: 100.00%
#> R/get_quantile.R: 100.00%
#> R/get_risktable.R: 100.00%
#> R/get_summary.R: 100.00%
#> R/get_tableone.R: 100.00%
#> R/render.R: 100.00%
#> R/tableone.R: 100.00%
#> R/tidyme.R: 100.00%
#> R/utils_general.R: 100.00%
#> R/utils_pipe.R: 100.00%
#> R/utils_table.R: 100.00%
#> R/utils_visr.R: 100.00%