Learn R Programming

rapbase

rapbase is an R package holding common R functions for Rapporteket which is a reporting service for Norwegian medical quality registries. Each registry at Rapporteket will have their content structured as R packages that are all found under the Rapporteket organization at GitHub. Such packages are likely to depend on the rapbase package.

Top-level information regarding Rapporteket is provided on a dedicated site (in Norwegian).

Install

Install rapbase from CRAN:

install.packages("rapbase")

The latest release of the package can be installed from GitHub:

remotes::install_github("Rapporteket/rapbase@*release")

Or install the development version from GitHub with:

remotes::install("Rapporteket/rapbase")

## Usage
Once the package is installed functions can be called from within R, *e.g.*:
```r
rapbase::halloRapporteket()

For a complete and updated view of the package documentation please consult the rapbase-site. Looking into how others have implemented rapbase for various registries is also an excellent way of learning the use of rapbase. In the rapRegTemplate package (in Norwegian) that provides a Shiny application template to be used for making registries there is some boiler plate code to aid start up. Please feel free to also contact the maintainers and authors directly.

Issues

Please provide any comments (e.g. on proposed enhancements, shortcomings, errors) through the issue tracker.

Contributing

If you want to make changes to this project please follow the Contributing guide. Proposed changes will be processed based on manual code reviews. Code that is accepted will be merged into the main branch and used for full scale TESTING and QA prior to making a release for PRODUCTION deployment.

For kick-starting, a development environment set-up is included and may be applied if docker and docker-compose is at hand. After cloning rapbase the development environment can be startet from a terminal at the local work copy root directory by:

docker-compose up

Navigate a browser to localhost on port 8787, log in to the RStudio IDE and initiate the project by "clicking" the file rapbase.Rproj inside the rapbase directory. For development all suggested imports for the rapbase R package will be needed. To make sure these are installed use the R Console and run

devtools::install_dev_deps()

After installing has finished all should be set to start change-build-test iterations :rocket:

Ethics

Please note that the 'rapbase' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

Copy Link

Version

Install

install.packages('rapbase')

Monthly Downloads

14

Version

1.24.2

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Are Edvardsen

Last Published

June 19th, 2023

Functions in rapbase (1.24.2)

getSessionData

Get session data
getRegs

Provide vector of registries (i.e. their R packages) in config
getRapPackages

Get all installed Rapporteket packages
getConfig

Get configuration for package, if any
getGithub

Collect various data from the GitHub API
export

Shiny modules providing GUI and server logic for Export
exportGuide

Shiny modules providing the Export Guide
filterAutoRep

Filter auto report data
howWeDealWithPersonalData

Render text in pop-up
halloRapporteket

Plain testing tool
makeRunDayOfYearSequence

Make a sequence of day numbers from av given date and interval
makeStandardTable

Make standard table for rmarkdown reports
navbarWidget

Shiny modules providing GUI and server logic for user info widget
%>%

Pipe operator
.data

Data pronouns
renderRmd

Render documents from rmarkdown files at Rapporteket
runNoweb

runNoweb
readLog

Read log entries
sanitizeLog

Sanitize log entries that have reached end of life
runBulletin

Run bulletin auto reports
findNextRunDate

Find next run date for automated reports
rapCloseDbConnection

Close down data connection handle
readAutoReportData

Read automated report metadata
makeAutoReportTab

Make table of automated reports
stagingDataHelper

Data staging helper (internal) functions
noOptOutOk

Provide a no-opt-out ok message
unitAttribute

Get unit attributes from an access tree file
statsGuide

Shiny modules providing the Stats Guide
runAutoReport

Run reports as defined in yaml config and ship content by email
loadRegData

Provider of data for registries at Rapporteket
logger

Log user events in shiny applications at Rapporteket
sendEmail

Send email from Rapporteket
makeLogRecord

Make a log record
stagingData

Staging data functions
rapbase

rapbase: Base Functions and Resources for Rapporteket
rapOpenDbConnection

Provide connection handle for data source at Rapporteket
upgradeAutoReportData

Upgrade auto reports
isPkgRapReg

Test if a package is part of Rapporteket
stats

Shiny modules and helper functions for registry usage reports
isRapContext

Rapporteket context
userInfo

Provide user attributes based on environment context
userAttribute

User attributes in container apps running behind shinyproxy
writeAutoReportData

Write automated report metadata
createAutoReport

Create and add report to config
appLog

App log test dataset.
createLogDb

Create a logging database
.testAutoReport

Simple test of automated report
deleteAutoReport

Delete existing report from config
autoReport

Shiny modules and helper functions for registry auto reports
appNavbarUserWidget

Create widget for registry apps at Rapporteket
.getFun

Provide explicit reference to function for do.call
fireInTheHole

Kick off functions at Rapporteket
appendLog

Append a log record
createLogDbTabs

Create tables for log entries in a database