Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

darwin-eu/visOmopResults

Repository files navigation

R-CMD-checkCRAN statusLifecycle:stableCodecov test coverage

Package overview

visOmopResults offers a set of functions tailored to format objectsof class<summarised_result> (as defined inomopgenericspackage).

It provides functionalities to create formattedtables and generateplots. These visualisations are highly versatile for reportingresults through Shiny apps, RMarkdown, Quarto, and more, supportingvarious output formats such as HTML, PNG, Word, and PDF.

Let’s get started

You can install the latest version ofvisOmopResults from CRAN:

install.packages("visOmopResults")

Or you can install the development version fromGitHub with:

# install.packages("pak")pak::pkg_install("darwin-eu/visOmopResults")

The<summarised_result> is a standardised output format utilizedacross various packages, including:

Although this standard output format is essential, it can sometimes bechallenging to manage. ThevisOmopResults package aims to simplifythis process. To demonstrate the package’s functionality, let’s start byusing some mock results:

library(visOmopResults)result<- mockSummarisedResult()

Tables visualisations

Currently all table functionalities are built around 4 packages:tibble,gt,flextable, anddatatable.

There are two main functions:

  • visOmopTable(): Creates a well-formatted table specifically from a<summarised_result> object.
  • visTable(): Creates a nicely formatted table from any<data.frame>object.

Let’s see a simple example:

result|>  filterStrata(sex!="overall"&age_group!="overall")|>  visOmopTable(type="flextable",estimateName= c("N(%)"="<count> (<percentage>%)","N"="<count>","mean (sd)"="<mean> (<sd>)"),header= c("sex","age_group"),settingsColumn=NULL,groupColumn= c("cohort_name"),rename= c("Variable"="variable_name",""="variable_level"),hide="cdm_name",style="darwin"  )

Plots visualisations

Currently all plot functionalities are built aroundggplot2. The output ofthese plot functions is a<ggplot2> object that can be furthercustomised.

There are three plotting functions:

  • plotScatter() to create a scatter plot.
  • plotBar() to create a bar plot.
  • plotBox() to create a box plot.

Additionally, thethemeVisOmop() function applies a consistent stylingto the plots, aligning them with the package’s visual design.

Let’s see how we can create a simple boxplot for age:

library(dplyr)result|>  filter(variable_name=="number subjects")|>  filterStrata(sex!="overall")|>  barPlot(x="age_group",y="count",facet="cohort_name",colour="sex",style="darwin"  )

Packages

No packages published

Contributors6

Languages


[8]ページ先頭

©2009-2025 Movatter.jp