Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
^docs$
^pkgdown$
^\.github$
^vignettes/articles$
^doc$
^Meta$
62 changes: 62 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
pull_request:

name: test-coverage.yaml

permissions: read-all

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
needs: coverage

- name: Test coverage
run: |
cov <- covr::package_coverage(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
print(cov)
covr::to_cobertura(cov)
shell: Rscript {0}

- uses: codecov/codecov-action@v5
with:
# Fail if error if not on PR, or if on PR and token is given
fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }}
files: ./cobertura.xml
plugins: noop
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ docs
.httr-oauth
.DS_Store
.quarto
/doc/
/Meta/
19 changes: 12 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: REDCapDM
Type: Package
Title: 'REDCap' Data Management
Version: 0.9.9.2000
Version: 1.0.0
Authors@R: c(
person("João", "Carmezim", email = "jcarmezim@igtp.cat", role = c("aut", "cre")),
person("Pau", "Satorra", role = c("aut")),
Expand All @@ -11,16 +11,15 @@ Authors@R: c(
person("Cristian", "Tebé", role = c("aut"))
)
Maintainer: João Carmezim <jcarmezim@igtp.cat>
Description: REDCap Data Management - REDCapDM is an R package that allows users to manage data exported directly from REDCap or using an API connection. This package includes several functions designed for pre-processing data, generating reports of queries such as outliers or missing values, and following up on the identified queries. 'REDCap' (Research Electronic Data CAPture; <https://projectredcap.org>) is a web application developed at Vanderbilt University, designed for creating and managing online surveys and databases and the REDCap API is an interface that allows external applications to connect to REDCap remotely, and is used to programmatically retrieve or modify project data or settings within REDCap, such as importing or exporting data.
Description: REDCap Data Management - 'REDCap' (Research Electronic Data CAPture; <https://projectredcap.org>) is a web application developed at Vanderbilt University, designed for creating and managing online surveys and databases and the REDCap API is an interface that allows external applications to connect to REDCap remotely, and is used to programmatically retrieve or modify project data or settings within REDCap, such as importing or exporting data. REDCapDM is an R package that allows users to manage data exported directly from REDCap or using an API connection. This package includes several functions designed for pre-processing data, generating reports of queries such as outliers or missing values, and following up on previously identified queries.
License: MIT + file LICENSE
URL: https://bruigtp.github.io/REDCapDM/, https://doi.org/10.1186/s12874-024-02178-6
BugReports: https://github.com/bruigtp/REDCapDM/issues
Encoding: UTF-8
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Imports:
dplyr,
janitor,
magrittr,
openxlsx,
purrr,
REDCapR,
Expand All @@ -33,12 +32,18 @@ Imports:
utils,
stringi,
cli,
forcats
forcats,
lifecycle
Suggests:
knitr,
rmarkdown,
kableExtra
kableExtra,
testthat (>= 3.0.0),
mockery
VignetteBuilder: knitr
Depends:
R (>= 3.6)
R (>= 4.1)
LazyData: true
Config/testthat/edition: 3
Config/Needs/website: rmarkdown
Roxygen: list(markdown = TRUE)
14 changes: 12 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(check_queries)
export(rd_checkbox)
export(rd_dates)
export(rd_delete_vars)
export(rd_dictionary)
export(rd_event)
export(rd_export)
export(rd_factor)
export(rd_insert_na)
export(rd_query)
export(rd_recalculate)
export(rd_rlogic)
export(rd_split)
export(rd_transform)
export(redcap_data)
import(cli)
importFrom(magrittr,"%>%")
importFrom(lifecycle,deprecated)
importFrom(rlang,":=")
importFrom(rlang,.data)
importFrom(rlang,eval_tidy)
importFrom(rlang,parse_expr)
importFrom(stats,na.omit)
importFrom(stats,setNames)
49 changes: 49 additions & 0 deletions R/REDCapDM-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#' @name REDCapDM-package
#' @keywords internal
#' @aliases REDCapDM
#'
#' @title Managing REDCap Data: The R package REDCapDM / REDCapDM: A Toolkit for Managing REDCap Data in R
#'
#' @description
#' The **REDCapDM** package provides tools to import, process, and manage REDCap data within R.
#' It supports data retrieval through the REDCap API or directly from exported files and includes a robust
#' set of functions for data transformation, validation, and discrepancy management. Designed for efficient
#' workflow integration, **REDCapDM** simplifies the handling of REDCap datasets, making it easier to ensure
#' data quality and consistency.
#'
#' Key Features:
#'
#' - **Flexible Data Import**: Import data directly from REDCap using API connections or process exported REDCap files.
#' - **Data Transformation**: Streamline the cleaning and preparation of raw datasets for analysis.
#' - **Query Management**: Identify and track data discrepancies, missing events, and manage resolution reports.
#'
#' Core Functions:
#'
#' - `redcap_data`: Reads data exported from REDCap or retrieved through the REDCap API into R.
#' - `rd_transform`: One-step pipeline to clean and preprocess the raw REDCap data.
#' - `rd_dates`: Standardize date and datetime fields.
#' - `rd_delete_vars`: Remove specified variables (by name or pattern).
#' - `rd_recalculate`: Recompute calculated fields and compare with REDCap values.
#' - `rd_factor`: Replace numeric multiple-choice columns with their factor version.
#' - `rd_checkbox`: Expand checkbox responses with custom labels and rename 'var___1' columns (REDCap style) to 'var_option'.
#' - `rd_split`: Splits a REDCap dataset by form or event.
#' - `rd_insert_na`: Manually set specified variables to missing based on a logical filter.
#' - `rd_rlogic`: Translate REDCap branching or calculation logic into R syntax.
#' - `rd_dictionary`: Update dictionary (translation of REDCap logic into R syntax) to reflect transformed data and logic.
#' - `rd_query`: Identifies discrepancies (queries) in the dataset for validation.
#' - `rd_event`: Detects missing events in longitudinal datasets.
#' - `check_queries`: Compares historical and current query reports to track changes and additions.
#' - `rd_export`: Exports a summary report of identified queries to an Excel (.xlsx) file.
#'
#'
#' @examples
#' \dontrun{
#' # Install REDCapDM from CRAN:
#' install.packages("REDCapDM")
#'
#' # Install the latest version of REDCapDM from GitHub:
#' remotes::install_github("bruigtp/REDCapDM")
#' }
#'
#' @importFrom lifecycle deprecated
NULL
37 changes: 0 additions & 37 deletions R/REDCapDM_PACKAGE.R

This file was deleted.

Loading