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

ropensci/mantis

R-CMD-checkCodecov test coverageProject Status: Active – The project has reached a stable, usable state and is being actively developed.Status at rOpenSci Software Peer Review

Themantis package generates interactive reports that enable quickvisual review of multiple related time series stored in a data frame.This can help with identification of temporal artefacts and unexpectedtrends. The choice of visualisations include interactive plots withadjustable axes and tooltips showing the individual dates and values, aswell as static heatmap and scatter plots for more lightweightapplications. E.g.

The resulting html reports are self-contained and shareable without aweb server.

Example reports and more detailed guidance can be found in thepackagewebsite, including how toaddalertingrules andhow to addmantis visualisations to your ownbespokereports.

Why should I use it?

We anticipate two main target users:

  1. Researchers who analyse data from large, temporal datasets,particularly routinely-collected data such as electronic healthrecords. Included as part of the initial analysis stage, it willhelp you to check for any temporal biases in your datasets beforeembarking on your main analyses, therefore improving the reliabilityof your study.

  2. Managers of live data feeds that are used as a data source fordownstream analyses. Regular inspection of data that is frequentlyupdated will help to identify any issues early and enable a timelyresponse to rectify issues such as missing data. While a set ofvalidation checks in a data pipeline could also work in thiscircumstance, the benefit of this package is the ability to checkfor temporal anomalies that are obvious to the human eye but thatare difficult to capture programmatically.

Installation

# install from CRANinstall.packages("mantis")# or install the current development version# either from rOpenSciinstall.packages("mantis",repos= c('https://ropensci.r-universe.dev','https://cloud.r-project.org'))# or direct from source# install stable dependencies firstinstall.packages(c("remotes","rmarkdown","knitr","reactable","dplyr","tidyr","dygraphs","xts","ggplot2","scales","purrr","htmltools","lubridate"))# install.packages("remotes")remotes::install_github("ropensci/mantis",dependencies=FALSE)

Usage

library(mantis)# this example data frame contains numbers of antibiotic prescriptions# in long formatdata("example_prescription_numbers")head(example_prescription_numbers)
## # A tibble: 6 × 5##   PrescriptionDate Antibiotic    Spectrum NumberOfPrescriptions Location##   <date>           <chr>         <chr>                    <dbl> <chr>   ## 1 2022-01-01       Coamoxiclav   Broad                       45 SITE1   ## 2 2022-01-01       Gentamicin    Broad                       34 SITE1   ## 3 2022-01-01       Ceftriaxone   Broad                       36 SITE1   ## 4 2022-01-01       Metronidazole Limited                     17 SITE1   ## 5 2022-01-01       Meropenem     Broad                       10 SITE1   ## 6 2022-01-01       Vancomycin    Limited                      0 SITE1
# create a report in the working directory, with one tab per Locationmantis_report(df=example_prescription_numbers,file="example_prescription_numbers_report.html",inputspec= inputspec(timepoint_col="PrescriptionDate",item_cols= c("Location","Antibiotic","Spectrum"),value_col="NumberOfPrescriptions",tab_col="Location",timepoint_unit="day"  ))

Relation to other packages

mantis is designed for use on data that is essentially a collection oftime series in a data frame, where you have already decided which valuesyou are interested in reviewing. If you want to check more generally fortemporal changes in record-level, non-numeric data, then check out oursister packagedaiquiri.

If you are not specifically interested in temporal changes, you couldtry visually inspecting your data frames withvisdat, or run validation checkson them withassertr orpointblank.

Acknowledgements

This work was supported by the National Institute for Health ResearchHealth Protection Research Unit (NIHR HPRU) in Healthcare AssociatedInfections and Antimicrobial Resistance at the University of Oxford inpartnership with the UK Health Security Agency (UKHSA) (NIHR200915), andby the NIHR Oxford Biomedical Research Centre.

Contributing to this package

Please report any bugs or suggestions by opening agithubissue.


[8]ページ先頭

©2009-2025 Movatter.jp