Learn R Programming

IalsaSynthesis (version 0.1.6)

validate: Functions that check the validty of values throughout the workflow.

Description

These functions help identify mistakes in formatting before the create difficult-to-diagnose problems later.

Usage

validate_filename_output(filename, path, file_extension_expected = "out", underscore_count_expected = 4L)

Arguments

filename
The name of the file to be validated.
path
The location of the file to be validated.
file_extension_expected
The extension of the file. This defaults to "out", which corresponds to Mplus output.
underscore_count_expected
The number of underscores required in the name (not currently used).

Value

An invisible TRUE value if the filename is valid. Otherwise, an error is thrown.

Examples

Run this code
library(IalsaSynthesis) #Load the package into the current R session.
## Not run: 
# path <- "./studies/eas"
# good_name <- "u1_male_aehplus_muscle_noCog_hand_noCogSpec.out"
# validate_filename_output(good_name, path)
# 
# bad_name <- "missing_something.outtttt"
# validate_filename_output(bad_name, path)
# ## End(Not run)

Run the code above in your browser using DataLab