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).
Arguments
- data
[character, data.frame, optional] Either
NULL, a length-one character path to a data file, or a data frame. IfNULL, data is loaded from the options file (you will be prompted to select or create one in interactive mode).- options
[character, optional] Name of the options file (with or without
.yamlextension). IfNULLand options are required, you will be prompted in interactive mode.- options_dir
[character, optional] Directory containing the options file. If
NULL, uses the default options directory.- preprocess
[logical, optional] If
TRUE(default), data is run through the full pipeline (read, preprocess, compute) so the viewer shows what runtime methods receive. IfFALSE, only the raw file read (for a path) or the given data frame is shown, without options-dependent standardization or preprocessing.
Value
Invisible NULL. Opens the data in the standard R viewer
(utils::View()). When no viewer is available (a non-interactive
session, or a Unix session with no reachable display), the first rows are
printed instead.
Details
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). Withpreprocess = TRUE, options are loaded and the full pipeline is applied.Data frame: pass a data frame. With
preprocess = FALSE, it is viewed as-is. Withpreprocess = 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). Withpreprocess = TRUE(default), the full pipeline (read, preprocess, compute) is run. Withpreprocess = 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()).
See also
artma- Run meta-analysis methodsprepare_data()- Prepare data manuallyoptions_load- Load options
Examples
if (FALSE) { # \dontrun{
# 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)
} # }