| Title: | Creating and Validating 'Psych-DS' Datasets |
|---|---|
| Description: | Provides a 'Shiny' application and helper functions for adopting 'Psych-DS' (<https://psych-ds.github.io/>), a community data standard for organizing and documenting datasets in the psychological and behavioral sciences inspired by the Brain Imaging Data Structure ('BIDS'). A guided interface walks researchers through the dataset creation process, organizing tabular data files into proper 'Psych-DS' directory structures, generating new, compliant, keyword-based filenames, and generating machine-readable 'JSON' metadata. Additional tools support building and editing data dictionaries with variable-level descriptions, validating datasets against the full 'Psych-DS' specification via a bundled 'JavaScript' validator, and exploring dataset contents interactively. |
| Authors: | Massachusetts Institute of Technology [cph], Brian Leonard [aut, cre] (ORCID: <https://orcid.org/0009-0005-7244-6882>), Melissa Kline Struhl [aut] (ORCID: <https://orcid.org/0000-0003-2217-9331>) |
| Maintainer: | Brian Leonard <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-10-15 20:45:54 UTC |
| Source: | https://github.com/cran/psychds |
This function provides robust package management following CRAN policies. It checks versions, handles conflicts, and provides clear user feedback.
check_dependencies( min_versions = NULL, recommended_versions = NULL, startup_mode = getOption("psychds.startup_mode", "recommended") )check_dependencies( min_versions = NULL, recommended_versions = NULL, startup_mode = getOption("psychds.startup_mode", "recommended") )
min_versions |
Named list of minimum required package versions |
recommended_versions |
Named list of recommended package versions |
startup_mode |
Character: "strict", "recommended", or "minimal" |
Logical indicating success
Verifies that all required and optional package dependencies are installed and meet minimum version requirements.
check_psychds_deps( install_missing = interactive(), detailed = FALSE, check_pdf = TRUE )check_psychds_deps( install_missing = interactive(), detailed = FALSE, check_pdf = TRUE )
install_missing |
Logical. If |
detailed |
Logical. If |
check_pdf |
Logical. Ignored. Retained for backwards compatibility.
Default is |
This function checks for:
Required packages: shiny, shinydashboard, shinyjs, DT, jsonlite
Optional packages: sortable, zip, pointblank
Minimum version requirements for each package
If dependencies are missing, the function provides installation instructions.
Invisibly returns a list with missing_required and
missing_recommended character vectors.
# Quick check check_psychds_deps() # Detailed check with environment info check_psychds_deps(detailed = TRUE)# Quick check check_psychds_deps() # Detailed check with environment info check_psychds_deps(detailed = TRUE)
Main entry point that ensures all dependencies are met
run_app_safe(app_dir = system.file("shiny", package = "psychds"), ...)run_app_safe(app_dir = system.file("shiny", package = "psychds"), ...)
app_dir |
Directory containing the Shiny app |
... |
Additional arguments passed to shiny::runApp |
No return value. Called for its side effect of launching the 'Shiny' application; blocks until the app is closed.
Launches the interactive Shiny application for creating, editing, and validating Psych-DS compliant datasets.
run_psych_ds_app( launch.browser = getOption("shiny.launch.browser", interactive()), port = getOption("shiny.port"), host = getOption("shiny.host", "127.0.0.1"), startup_mode = getOption("psychds.startup_mode", "recommended"), force_browser = getOption("psychds.force_browser", FALSE), ... )run_psych_ds_app( launch.browser = getOption("shiny.launch.browser", interactive()), port = getOption("shiny.port"), host = getOption("shiny.host", "127.0.0.1"), startup_mode = getOption("psychds.startup_mode", "recommended"), force_browser = getOption("psychds.force_browser", FALSE), ... )
launch.browser |
Logical or function. Should the app be opened in a
browser? Defaults to |
port |
Integer. Port number for the application. If |
host |
Character. Host IP address. Defaults to |
startup_mode |
Character. One of
|
force_browser |
Logical. Force opening in external browser. Recommended for RStudio users experiencing viewer issues. |
... |
Additional arguments passed to |
The application provides a guided interface for:
Selecting project directories and data files
Adding dataset metadata
Standardizing filenames with Psych-DS keywords
Generating data dictionaries
Validating datasets against the Psych-DS specification
This function does not return a value. It launches the Shiny application and blocks until the app is closed.
check_psychds_deps() for verifying dependencies before running.
if (interactive()) { # Standard launch run_psych_ds_app() # Force external browser (if RStudio viewer has issues) run_psych_ds_app(force_browser = TRUE) # Minimal checking for faster startup run_psych_ds_app(startup_mode = "minimal") # Specific port run_psych_ds_app(port = 3838) }if (interactive()) { # Standard launch run_psych_ds_app() # Force external browser (if RStudio viewer has issues) run_psych_ds_app(force_browser = TRUE) # Minimal checking for faster startup run_psych_ds_app(startup_mode = "minimal") # Specific port run_psych_ds_app(port = 3838) }
Validates a dataset directory against the full 'Psych-DS' specification using the same validator used by the 'psychds-validator' command-line tool.
validate_dataset(dir_path, json = FALSE, verbose = FALSE, use_events = FALSE)validate_dataset(dir_path, json = FALSE, verbose = FALSE, use_events = FALSE)
dir_path |
Path to the 'Psych-DS' dataset directory to validate. |
json |
Logical. If |
verbose |
Logical. If |
use_events |
Logical. If |
Requires 'Node.js' to be installed and available on the system PATH. Install 'Node.js' from https://nodejs.org.
Invisibly returns the exit status. Called for its side effect of printing validation results to the console.
## Not run: # Standard text output validate_dataset("path/to/my-study") # JSON output for programmatic use validate_dataset("path/to/my-study", json = TRUE) # Verbose with warnings validate_dataset("path/to/my-study", verbose = TRUE) # Live checklist validate_dataset("path/to/my-study", use_events = TRUE) ## End(Not run)## Not run: # Standard text output validate_dataset("path/to/my-study") # JSON output for programmatic use validate_dataset("path/to/my-study", json = TRUE) # Verbose with warnings validate_dataset("path/to/my-study", verbose = TRUE) # Live checklist validate_dataset("path/to/my-study", use_events = TRUE) ## End(Not run)