| Title: | Automatic Replication Tools for Meta-Analysis |
|---|---|
| Description: | Provides a unified and straightforward interface for performing a variety of meta-analysis methods directly from user data. Users can input a data frame, specify key parameters, and effortlessly execute and compare multiple common meta-analytic models. Designed for immediate usability, the package facilitates transparent, reproducible research without manual implementation of each analytical method. Ideal for researchers aiming for efficiency and reproducibility, it streamlines workflows from data preparation to results interpretation. |
| Authors: | Petr Čala [aut, cre] |
| Maintainer: | Petr Čala <[email protected]> |
| License: | GPL-3 |
| Version: | 0.3.3 |
| Built: | 2026-05-15 05:40:38 UTC |
| Source: | https://github.com/petrcala/artma |
Main entry point for the artma package. This function orchestrates the complete meta-analysis workflow: loading options, preparing data, and running specified analytical methods.
artma( data = NULL, methods = NULL, options = NULL, options_dir = NULL, open_results = FALSE, ... )artma( data = NULL, methods = NULL, options = NULL, options_dir = NULL, open_results = FALSE, ... )
data |
[data.frame, optional] Data frame to analyze. If |
methods |
[character, optional] A character vector of method names to run.
Use |
options |
[character, optional] Name of the options file (with or without
|
options_dir |
[character, optional] Directory containing the options file.
If |
open_results |
[logical, optional] Whether to open the results directory
after exporting results. Defaults to |
... |
Additional arguments passed to the runtime methods. |
The artma() function is the primary way to interact with the artma package.
It handles the complete workflow:
Options Loading: Loads configuration from an options file (or prompts for creation in interactive mode)
Data Preparation: Reads and prepares your data (unless data is provided)
Method Execution: Runs the specified analytical methods on your data
Results: Returns a structured list of results
Options files are YAML configuration files that store all settings for your analysis, including data paths, column mappings, method parameters, and output preferences. They ensure reproducibility and make it easy to manage multiple analysis configurations.
Methods are analytical functions that perform specific meta-analysis tasks (e.g., funnel plots, Bayesian Model Averaging, effect size calculations). You can run multiple methods in a single call, and they will execute in a predefined order.
When data is provided, it bypasses the data reading step and uses your data frame
directly. The data will still be preprocessed and validated according to your
options configuration. This is useful when you already have data loaded in R or
want to analyze data programmatically.
[list] A named list containing results from each method, indexed by method name. The structure of each result depends on the specific method.
artma::methods.list() - List available methods
artma::options.create() - Create a new options file
artma::prepare_data() - Prepare data manually
## Not run: # Interactive mode - will prompt for options and methods results <- artma() # Run specific methods with an options file results <- artma( methods = c("funnel_plot", "bma", "fma"), options = "my_analysis.yaml" ) # Run all methods results <- artma(methods = "all", options = "my_analysis.yaml") # Use data directly (bypasses file reading) my_data <- data.frame( effect = c(0.5, 0.3, 0.7), se = c(0.1, 0.15, 0.12), study_id = c("Study A", "Study B", "Study C") ) results <- artma(data = my_data, methods = "funnel_plot") # Access results funnel_result <- results$funnel_plot ## End(Not run)## Not run: # Interactive mode - will prompt for options and methods results <- artma() # Run specific methods with an options file results <- artma( methods = c("funnel_plot", "bma", "fma"), options = "my_analysis.yaml" ) # Run all methods results <- artma(methods = "all", options = "my_analysis.yaml") # Use data directly (bypasses file reading) my_data <- data.frame( effect = c(0.5, 0.3, 0.7), se = c(0.1, 0.15, 0.12), study_id = c("Study A", "Study B", "Study C") ) results <- artma(data = my_data, methods = "funnel_plot") # Access results funnel_result <- results$funnel_plot ## End(Not run)
Get a human-readable description of an autonomy level.
autonomy.describe(level = NULL)autonomy.describe(level = NULL)
level |
[integer, optional] The autonomy level (1-5). If NULL, describes the current level. |
[character] A description of the autonomy level.
## Not run: # Get description of current level desc <- autonomy.describe() print(desc) # Get description of a specific level desc <- autonomy.describe(5) print(desc) ## End(Not run)## Not run: # Get description of current level desc <- autonomy.describe() print(desc) # Get description of a specific level desc <- autonomy.describe(5) print(desc) ## End(Not run)
Get the current autonomy level. Autonomy controls how much user interaction is required during analysis. Higher levels mean less user interaction and more automatic decision-making.
autonomy.get()autonomy.get()
[integer or NULL] The current autonomy level (1-5), or NULL if not set.
## Not run: # Get current autonomy level level <- autonomy.get() print(level) ## End(Not run)## Not run: # Get current autonomy level level <- autonomy.get() print(level) ## End(Not run)
Check if the package is running in fully autonomous mode (level 5).
autonomy.is_full()autonomy.is_full()
[logical] TRUE if fully autonomous, FALSE otherwise.
## Not run: if (autonomy.is_full()) { message("Running in fully autonomous mode") } ## End(Not run)## Not run: if (autonomy.is_full()) { message("Running in fully autonomous mode") } ## End(Not run)
Check if the autonomy level has been configured.
autonomy.is_set()autonomy.is_set()
[logical] TRUE if the autonomy level is set, FALSE otherwise.
## Not run: if (!autonomy.is_set()) { message("Autonomy level not configured") } ## End(Not run)## Not run: if (!autonomy.is_set()) { message("Autonomy level not configured") } ## End(Not run)
Get information about all available autonomy levels.
autonomy.levels()autonomy.levels()
[list] A list of autonomy level definitions.
## Not run: levels <- autonomy.levels() print(levels) ## End(Not run)## Not run: levels <- autonomy.levels() print(levels) ## End(Not run)
Set the autonomy level for the current session. This setting controls how much user interaction is required during analysis.
autonomy.set(level)autonomy.set(level)
level |
[integer] The autonomy level to set (1-5).
|
NULL (invisible)
## Not run: # Set to fully autonomous mode autonomy.set(5) # Set to balanced mode autonomy.set(3) ## End(Not run)## Not run: # Set to fully autonomous mode autonomy.set(5) # Set to balanced mode autonomy.set(3) ## End(Not run)
Regenerate the data config from the dataframe, clearing all overrides.
config.fix(options_file_name = NULL, options_dir = NULL)config.fix(options_file_name = NULL, options_dir = NULL)
options_file_name |
[character, optional] The name of the options
file. If |
options_dir |
[character, optional] The directory containing options
files. If |
[list] The fixed data config.
Returns the fully-resolved data config (base defaults merged
with sparse overrides). If var_name is provided, returns only that
variable's config entry.
config.get(var_name = NULL, options_file_name = NULL, options_dir = NULL)config.get(var_name = NULL, options_file_name = NULL, options_dir = NULL)
var_name |
[character, optional] A specific variable name to
retrieve. If |
options_file_name |
[character, optional] The name of the options
file. If |
options_dir |
[character, optional] The directory containing options
files. If |
[list] The fully-resolved data config (or a single entry).
Returns only the sparse overrides that are actually persisted in the options file – i.e., only non-default field values.
config.overrides(options_file_name = NULL, options_dir = NULL)config.overrides(options_file_name = NULL, options_dir = NULL)
options_file_name |
[character, optional] The name of the options
file. If |
options_dir |
[character, optional] The directory containing options
files. If |
[list] The sparse overrides (only non-default values).
Removes all overrides for a specific variable (or all variables), resetting them to auto-detected defaults.
config.reset(var_name = NULL, options_file_name = NULL, options_dir = NULL)config.reset(var_name = NULL, options_file_name = NULL, options_dir = NULL)
var_name |
[character, optional] The variable name to reset. If
|
options_file_name |
[character, optional] The name of the options
file. If |
options_dir |
[character, optional] The directory containing options
files. If |
[list] The updated fully-resolved data config (invisibly).
Sets specific config fields for a variable. Only non-default values are persisted to the options file.
config.set(var_name, ..., options_file_name = NULL, options_dir = NULL)config.set(var_name, ..., options_file_name = NULL, options_dir = NULL)
var_name |
[character] The variable name to configure. |
... |
Named arguments for config fields to set
(e.g., |
options_file_name |
[character, optional] The name of the options
file. If |
options_dir |
[character, optional] The directory containing options
files. If |
[list] The updated fully-resolved data config (invisibly).
Open a data frame in R's viewer. Data can be supplied as a file path, a data
frame, or loaded from an options file (with the same prompt flow as
artma() when no options are given).
data.preview( data = NULL, options = NULL, options_dir = NULL, preprocess = TRUE )data.preview( data = NULL, options = NULL, options_dir = NULL, preprocess = TRUE )
data |
[character, data.frame, optional] Either |
options |
[character, optional] Name of the options file (with or
without |
options_dir |
[character, optional] Directory containing the options
file. If |
preprocess |
[logical, optional] If |
Three data sources are supported:
Path: pass a length-one character path to a data file. With
preprocess = FALSE, the file is read without loading options
(raw read). With preprocess = TRUE, options are loaded and the
full pipeline is applied.
Data frame: pass a data frame. With preprocess = FALSE,
it is viewed as-is. With preprocess = TRUE, options are loaded
and preprocess + compute are applied before viewing.
NULL: data comes from the chosen options file (same
"select or create options file" flow as artma() with empty
arguments). With preprocess = TRUE (default), the full pipeline
(read, preprocess, compute) is run. With preprocess = FALSE, only
the data as read from file (with column standardization from options) is
shown, without preprocessing or computed columns.
In non-interactive mode, when data is NULL and options
is NULL, no viewer is shown (consistent with artma()).
Invisible NULL. Opens the data in the standard R viewer
(utils::View()).
artma - Run meta-analysis methods
prepare_data() - Prepare data manually
options.load - Load options
## Not run: # Preview data from options file (prompts for file if NULL) data.preview(options = "my_analysis.yaml") # Preview raw file without loading options data.preview("/path/to/data.csv", preprocess = FALSE) # Preview preprocessed data from a path (uses options for standardization) data.preview("/path/to/data.csv", options = "my_analysis.yaml") # Preview a data frame as-is data.preview(mtcars, preprocess = FALSE) ## End(Not run)## Not run: # Preview data from options file (prompts for file if NULL) data.preview(options = "my_analysis.yaml") # Preview raw file without loading options data.preview("/path/to/data.csv", preprocess = FALSE) # Preview preprocessed data from a path (uses options for standardization) data.preview("/path/to/data.csv", options = "my_analysis.yaml") # Preview a data frame as-is data.preview(mtcars, preprocess = FALSE) ## End(Not run)
Print all runtime methods supported by artma into the console.
methods.list()methods.list()
NULL Prints the available methods into the console.
Provide a name of a user options file to copy from, and a name of a file to copy to, and copy from the 'from' file to the 'to' file.
options.copy( options_file_name_from = NULL, options_file_name_to = NULL, options_dir = NULL, should_overwrite = NULL )options.copy( options_file_name_from = NULL, options_file_name_to = NULL, options_dir = NULL, should_overwrite = NULL )
options_file_name_from |
[character, optional] Name of the options file to copy from. If not provided, the user will be prompted. Defaults to |
options_file_name_to |
[character, optional] Name of the options file to copy to. If not provided, the user will be prompted. Defaults to |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
should_overwrite |
[logical, optional] Whether to overwrite an existing file without asking. If |
NULL
Create a new user options file from an options template.
options.create( options_file_name = NULL, options_dir = NULL, template_path = NULL, user_input = list(), should_validate = TRUE, should_overwrite = FALSE, action_name = "creating" )options.create( options_file_name = NULL, options_dir = NULL, template_path = NULL, user_input = list(), should_validate = TRUE, should_overwrite = FALSE, action_name = "creating" )
options_file_name |
[character] Name of the new user options file, including the suffix. |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
template_path |
[character, optional] Full path to the options template file. |
user_input |
[list, optional] A named list of user-supplied values for these options. If |
should_validate |
[logical, optional] If TRUE, validate the new options file against the template. Defaults to TRUE. |
should_overwrite |
[logical, optional] If TRUE, overwrite the file if it already exists. Defaults to FALSE, in which case the user is prompted to confirm the overwrite. |
action_name |
[character, optional] A name for the action being performed. This is used for logging purposes. Defaults to "create".
|
NULL
Provide a name of a user options file to delete, and delete that file.
options.delete( options_file_name = NULL, options_dir = NULL, skip_confirmation = FALSE )options.delete( options_file_name = NULL, options_dir = NULL, skip_confirmation = FALSE )
options_file_name |
[character, optional] Name of the options file to delete. If not provided, the user will be prompted. Defaults to |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
skip_confirmation |
[boolean, optional] If passed as TRUE, the user will not be prompted for deletion confirmation. Defaults to FALSE. |
NULL
Fix a user options file by setting the default values for missing options.
options.fix( options_file_name = NULL, options_dir = NULL, template_path = NULL, force_default_overwrites = TRUE )options.fix( options_file_name = NULL, options_dir = NULL, template_path = NULL, force_default_overwrites = TRUE )
options_file_name |
[character, optional] Name of the options file to fix, including the .yaml suffix. Defaults to |
options_dir |
[character, optional] Path to the folder in which to look for user options files. Defaults to |
template_path |
[character, optional] Path to the options template file. Defaults to |
force_default_overwrites |
[logical, optional] If set to TRUE, the function will overwrite the existing options file with the default values. Defaults to TRUE. |
The function will attempt to load the user options file and validate it. If any errors are found, the function will attempt to fix them by setting the default values for the missing options.
NULL Fixes the user options file.
Prints information for each requested option (or all options if options is NULL).
options.help(options = NULL, template_path = NULL)options.help(options = NULL, template_path = NULL)
options |
[character, optional] A single option name (dot-separated) or a
character vector thereof. If |
template_path |
[character, optional] Path to the template YAML file.
Defaults to |
Invisibly returns NULL, printing the requested information
to the console.
Retrieves the list of the existing options files and returns their names as a character vector. By default, this retrieves the names of the files including the yaml suffix, but can be modified to retrieve options verbose names instead.
options.list(options_dir = NULL, should_return_verbose_names = FALSE)options.list(options_dir = NULL, should_return_verbose_names = FALSE)
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
should_return_verbose_names |
[logical, optional] If set to TRUE, the custom names of each of the options files are read and returned instead of file names. Defaults to FALSE. |
[vector, character] A character vector with the names of the options available.
Load user options by their name and return them as a list.
options.load( options_file_name = NULL, options_dir = NULL, create_options_if_null = TRUE, load_with_prefix = TRUE, template_path = NULL, should_validate = TRUE, should_set_to_namespace = FALSE, should_add_temp_options = FALSE, should_return = TRUE )options.load( options_file_name = NULL, options_dir = NULL, create_options_if_null = TRUE, load_with_prefix = TRUE, template_path = NULL, should_validate = TRUE, should_set_to_namespace = FALSE, should_add_temp_options = FALSE, should_return = TRUE )
options_file_name |
[character, optional] Name of the options to load, including the .yaml suffix. Defaults to |
options_dir |
[character, optional] Path to the folder in which to look for user options files. Defaults to |
create_options_if_null |
[logical, optional] If set to TRUE and the options file name is set to NULL, the function will prompt the user to create a new options file. Defaults to TRUE. |
load_with_prefix |
[logical, optional] Whether the options should be loaded with the package prefix. Defaults to TRUE. |
template_path |
[character, optional] Path to the template YAML file. Defaults to |
should_validate |
[logical, optional] Whether the options should be validated after loading. Defaults to TRUE. |
should_set_to_namespace |
[logical, optional] Whether the options should be set in the options() namespace. Defaults to TRUE. |
should_add_temp_options |
[logical, optional] Whether the options should be added to the temporary options. Defaults to FALSE. |
should_return |
[logical, optional] Whether the function should return the list of options. Defaults to FALSE. |
In case the options name is not passed, the function will attempt to load the current options configuration. If none is found, it will then attempt to load the default options. If that fails too, an error is raised.
[list|NULL] The loaded options as a list or NULL.
Modify an existing user options file with new values.
options.modify( options_file_name = NULL, options_dir = NULL, template_path = NULL, user_input = list(), should_validate = TRUE )options.modify( options_file_name = NULL, options_dir = NULL, template_path = NULL, user_input = list(), should_validate = TRUE )
options_file_name |
[character, optional] Name of the user options file to modify, including the suffix. |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
template_path |
[character, optional] Full path to the options template file. Defaults to |
user_input |
[list, optional] A named list of user-supplied values for these options. If |
should_validate |
[logical, optional] If TRUE, validate the modified options file against the template. Defaults to TRUE. |
NULL
Open an options file for editing. Must be run interactively. The editor is resolved from: (1) cli.editor option, (2) VISUAL/EDITOR env vars, or (3) system default file handler.
options.open(options_file_name = NULL, options_dir = NULL)options.open(options_file_name = NULL, options_dir = NULL)
options_file_name |
[character, optional] Name of the user options file to modify, including the suffix. |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
NULL Opens the file for editing
Prints the full path to the directory where user options are stored by default
options.print_default_dir(...)options.print_default_dir(...)
... |
[any] Additional arguments. |
NULL Prints the default directory to console.
Provide a name of a user options file to remove, and remove that file.
options.remove( options_file_name = NULL, options_dir = NULL, skip_confirmation = FALSE )options.remove( options_file_name = NULL, options_dir = NULL, skip_confirmation = FALSE )
options_file_name |
[character, optional] Name of the options file to remove. If not provided, the user will be prompted. Defaults to |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
skip_confirmation |
[boolean, optional] If passed as TRUE, the user will not be prompted for deletion confirmation. Defaults to FALSE. |
This function is an alias for options.delete and behaves identically.
NULL
This function reads a YAML template and an options file, flattens both structures, and then checks that:
Every option defined in the template is present in the options file.
The value for each option is of the correct type.
(Optionally) It warns about extra options in the file that are not defined in the template.
options.validate( options_file_name = NULL, options_dir = NULL, should_flag_redundant = FALSE, template_path = NULL, failure_action = "abort_verbose" )options.validate( options_file_name = NULL, options_dir = NULL, should_flag_redundant = FALSE, template_path = NULL, failure_action = "abort_verbose" )
options_file_name |
[character] Name of the user options file to validate, including the suffix. |
options_dir |
[character, optional] Full path to the folder that contains user options files. If not provided, the default folder is chosen. Defaults to |
should_flag_redundant |
[logical, optional] If TRUE, warn the user about any extraneous options (i.e., options not defined in the options template, such as custom options that the user might have added). Defaults to FALSE. |
template_path |
[character, optional] Full path to the options template file. Defaults to |
failure_action |
[character] Action to take if validation fails. Can be one of: 'abort_verbose', 'abort_quiet', 'return_errors_verbose', 'return_errors_quiet'. Defaults to 'abort_verbose'.
|
For each problem found (missing option or type mismatch), an error message is printed.
[list] The validation errors
Print method for box_plot results
## S3 method for class 'artma_box_plot' print(x, ...)## S3 method for class 'artma_box_plot' print(x, ...)
x |
An artma_box_plot object |
... |
Additional arguments (ignored) |
x invisibly
Print method for funnel_plot results
## S3 method for class 'artma_funnel_plot' print(x, ...)## S3 method for class 'artma_funnel_plot' print(x, ...)
x |
An artma_funnel_plot object |
... |
Additional arguments (ignored) |
x invisibly
Print method for t_stat_histogram results
## S3 method for class 'artma_t_stat_histogram' print(x, ...)## S3 method for class 'artma_t_stat_histogram' print(x, ...)
x |
An artma_t_stat_histogram object |
... |
Additional arguments (ignored) |
x invisibly
Returns the resolved path to the output directory where analysis results (tables, graphics) are saved. The path is printed and returned invisibly. When called without arguments, tries to use the most recently exported directory without prompting for an options file.
results.dir(options = NULL, options_dir = NULL)results.dir(options = NULL, options_dir = NULL)
options |
[character, optional] Name of the options file (with or
without |
options_dir |
[character, optional] Directory containing the options
file. If |
[character] The resolved output directory path (invisibly).
## Not run: # Get the most recent results directory results.dir() # Get results dir for a specific options file results.dir(options = "my_analysis.yaml") ## End(Not run)## Not run: # Get the most recent results directory results.dir() # Get results dir for a specific options file results.dir(options = "my_analysis.yaml") ## End(Not run)
Opens the output directory in the system file browser (Finder on macOS, Explorer on Windows, or the default file manager on Linux). When called without arguments, tries to open the most recently exported results directory without prompting for an options file.
results.open(options = NULL, options_dir = NULL, use_last = TRUE)results.open(options = NULL, options_dir = NULL, use_last = TRUE)
options |
[character, optional] Name of the options file (with or
without |
options_dir |
[character, optional] Directory containing the options
file. If |
use_last |
[logical] If |
[character] The resolved output directory path (invisibly).
## Not run: # Open the most recent results (no prompt if a recent export exists) results.open() # Force options-based resolution (will prompt if needed) results.open(use_last = FALSE) # Open results for a specific options file results.open(options = "my_analysis.yaml") ## End(Not run)## Not run: # Open the most recent results (no prompt if a recent export exists) results.open() # Force options-based resolution (will prompt if needed) results.open(use_last = FALSE) # Open results for a specific options file results.open(options = "my_analysis.yaml") ## End(Not run)
Get the current visualization settings. Returns all settings as a list, or a single setting by name.
viz.get(option = NULL)viz.get(option = NULL)
option |
[character, optional] Name of a specific option to retrieve.
One of: |
A named list of all visualization settings, or a single setting value.
## Not run: # Get all visualization settings viz.get() # Get just the current theme viz.get("theme") # Get export path viz.get("export_path") ## End(Not run)## Not run: # Get all visualization settings viz.get() # Get just the current theme viz.get("theme") # Get export path viz.get("export_path") ## End(Not run)
Set visualization options for the current session. Only provided arguments are changed; others remain unchanged.
viz.set( theme = NULL, export_graphics = NULL, export_path = NULL, graph_scale = NULL )viz.set( theme = NULL, export_graphics = NULL, export_path = NULL, graph_scale = NULL )
theme |
[character, optional] Color theme. Use |
export_graphics |
[logical, optional] If TRUE, export plots to files. |
export_path |
[character, optional] Directory path for exported plots. |
graph_scale |
[numeric, optional] Scaling factor for exported graphics. Values > 1 increase resolution. |
Previous settings (invisibly), enabling easy restoration.
## Not run: # Change theme viz.set(theme = "purple") # Enable export with custom path viz.set(export_graphics = TRUE, export_path = "./output/plots") # Save and restore settings prev <- viz.set(theme = "red") # ... do work ... do.call(viz.set, prev) ## End(Not run)## Not run: # Change theme viz.set(theme = "purple") # Enable export with custom path viz.set(export_graphics = TRUE, export_path = "./output/plots") # Save and restore settings prev <- viz.set(theme = "red") # ... do work ... do.call(viz.set, prev) ## End(Not run)
Get the names of all available visualization themes.
viz.themes()viz.themes()
[character] Vector of valid theme names.
## Not run: viz.themes() # [1] "blue" "yellow" "green" "red" "purple" ## End(Not run)## Not run: viz.themes() # [1] "blue" "yellow" "green" "red" "purple" ## End(Not run)