create_DataFile {BayLum}R Documentation

Prepare input data for subsequent BayLum Analysis

Description

The function pre-processes input data from BIN/BINX file, XSYG files or RLum.Analysis objects for 'BayLum'. The parameters for the modelling are controlled by a to be supplied YAML configuration file (please read package vignette).

Usage

create_DataFile(config_file, verbose = TRUE)

Arguments

config_file

character (required): path to YAML configuration file; alternatively the config_file can be a list similar to the R representation of the imported YAML file. This enables on-the fly modifications

verbose

logical (with default): enable/disable terminal feedback

Details

The function uses a single configuration file based on the YAML format and operates in two modes:

(1) The YAML file contains the path to the files and the function attempts to import them. In such a case, all files must be thoroughly prepared (e.g., strictly follow the SAR protocol etc.).

(2) Alternatively, the YAML file contains no file paths but the data were imported and processed before create_DataFile() was called (recommended). Then the function is searching for objects with the sample name in the global environment. Example: samp1 <- Luminescence::read_BIN2R(...) with samp1 the sample name as specified in the YAML file.

For more details, please see the package vignette.

Value

Returns a list that can be processed by the modelling functions of 'BayLum'

Function version

0.1.0

Author(s)

Sebastian Kreutzer, Institute of Geography, Ruprecht-Karl University of Heidelberg (Germany), in parts based on code by Claire Christophe , RLum Developer Team

See Also

write_YAMLConfigFile, yaml::read_yaml, Luminescence::read_BIN2R, Luminescence::read_XSYG2R, Luminescence::subset_SingleGrainData

Examples

##set path to YAML file
yaml_file <- system.file("extdata/example.yml", package = "BayLum")

samp1_file <- system.file("extdata/samp1/bin.bin", package = "BayLum")
samp2_file <- system.file("extdata/samp2/bin.bin", package = "BayLum")

## import BIN files
samp1 <- Luminescence::read_BIN2R(samp1_file, verbose = FALSE) |>
 subset(POSITION == 2 & GRAIN == 32)
samp2 <- Luminescence::read_BIN2R(samp2_file, verbose = FALSE) |>
 subset(POSITION == 2 & GRAIN == 32)

## create file
create_DataFile(yaml_file)


[Package BayLum version 0.3.2 Index]