Skip to contents

Control memory usage warnings for large dataset operations in fmristore. These warnings help users understand when operations may consume significant memory.

Usage

configure_memory_warnings(enable = TRUE, threshold_mb = 100, verbose = FALSE)

Arguments

enable

Logical. Whether to enable memory usage warnings (default: TRUE).

threshold_mb

Numeric. Memory threshold in MB above which warnings are issued (default: 100).

verbose

Logical. Whether to print confirmation of setting changes (default: FALSE).

Details

The memory warning system estimates the size of data that will be loaded into memory and issues warnings when this exceeds the specified threshold. This helps users make informed decisions about subsetting large datasets.

Settings are stored as R options and persist for the current R session: - `fmristore.warn_memory`: Enable/disable warnings - `fmristore.memory_threshold_mb`: Warning threshold in MB

Examples

# Enable warnings for datasets larger than 50MB
configure_memory_warnings(enable = TRUE, threshold_mb = 50)

# Disable memory warnings
configure_memory_warnings(enable = FALSE)

# Check current settings
list(
  enabled = getOption("fmristore.warn_memory", TRUE),
  threshold_mb = getOption("fmristore.memory_threshold_mb", 100)
)
#> $enabled
#> [1] FALSE
#> 
#> $threshold_mb
#> [1] 100
#>