- Notifications
You must be signed in to change notification settings - Fork0
License
ropensci/mantis
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
We anticipate two main target users:
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.
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.
# 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)
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" ))
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.
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.
Please report any bugs or suggestions by opening agithubissue.
About
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.

