Learn R Programming

stepmetrics (version 1.0.3)

isGGIRoutput: Check if a directory is a valid GGIR output folder for stepmetrics

Description

Determines whether a given directory corresponds to a valid GGIR output directory that can be used with stepmetrics. Several conditions are checked in sequence:

  1. Path exists and is a directory.

  2. Directory name begins with `"output_"`.

  3. Contains a `meta/` subfolder.

  4. Contains a `meta/ms2.out/` subfolder (GGIR part 2 milestone data).

  5. Contains at least one `*.RData` file in `ms2.out`.

  6. The loaded object IMP$metashort includes a step column (with `"step"` in its name).

If any of these checks fail, the function returns FALSE and issues a warning describing the missing requirement.

Usage

isGGIRoutput(path)

Value

Logical scalar. Returns TRUE if the directory appears to be valid GGIR output suitable for stepmetrics, otherwise FALSE.

Arguments

path

Character. Path to the directory to be tested.

See Also

[step.metrics()]

Examples

Run this code
if (FALSE) {
# GGIR output folder
ggir_output_dir = system.file("extdata", "testfiles_GGIR", "output_test", package = "stepmetrics")
isGGIRoutput(ggir_output_dir)

# Non-GGIR directory
isGGIRoutput("C:/mystudy/rawdata/")
}

Run the code above in your browser using DataLab