Learn R Programming

Luminescence (version 1.1.2)

add_metadata<-: Safe manipulation of object metadata

Description

Generic functions for manipulation of metadata in Risoe.BINfileData, RLum.Analysis and RLum.Data objects.

Usage

add_metadata(object, ...) <- value

rename_metadata(object, ...) <- value

replace_metadata(object, ...) <- value

# S4 method for RLum.Analysis add_metadata(object, info_element) <- value

# S4 method for RLum.Analysis rename_metadata(object, info_element) <- value

# S4 method for RLum.Analysis replace_metadata(object, info_element, subset = NULL) <- value

# S4 method for RLum.Data add_metadata(object, info_element) <- value

# S4 method for RLum.Data rename_metadata(object, info_element) <- value

# S4 method for RLum.Data replace_metadata(object, info_element, subset = NULL, verbose = TRUE) <- value

# S4 method for Risoe.BINfileData add_metadata(object, info_element) <- value

# S4 method for Risoe.BINfileData rename_metadata(object, info_element) <- value

# S4 method for Risoe.BINfileData replace_metadata(object, info_element, subset = NULL) <- value

Arguments

object

RLum.Analysis, Risoe.BINfileData (required): object of class RLum.Analysis or Risoe.BINfileData to manipulate.

...

further arguments passed to the specific class method

value

(required): value to be assigned to the selected metadata entry. A NULL value is acceptable only for replace_metadata, in which case the elements named in info_element will be removed.

info_element

character (required): name of the metadata entry to manipulate.

subset

expression (optional): logical expression to limit the substitution only to the selected subset of elements.

verbose

logical (with default): enable/disable output to the terminal.

Functions

  • add_metadata(RLum.Analysis) <- value: Adds metadata to RLum.Analysis objects.

  • rename_metadata(RLum.Analysis) <- value: Renames a metadata entry of RLum.Analysis objects.

  • replace_metadata(RLum.Analysis) <- value: Replaces or removes metadata of RLum.Analysis objects.

  • add_metadata(RLum.Data) <- value: Add metadata entries to RLum.Data objects.

  • rename_metadata(RLum.Data) <- value: Rename a metadata entry of RLum.Data objects.

  • replace_metadata(RLum.Data) <- value: Replaces or removes metadata of RLum.Data objects.

  • add_metadata(Risoe.BINfileData) <- value: Adds metadata to Risoe.BINfileData objects.

  • rename_metadata(Risoe.BINfileData) <- value: Renames a metadata entry of Risoe.BINfileData objects.

  • replace_metadata(Risoe.BINfileData) <- value: Replaces or removes metadata of Risoe.BINfileData objects.

Author

Marco Colombo, Institute of Geography, Heidelberg University (Germany) , RLum Developer Team

How to cite

Colombo, M., 2025. add_metadata<-(): Safe manipulation of object metadata. In: Kreutzer, S., Burow, C., Dietze, M., Fuchs, M.C., Schmidt, C., Fischer, M., Friedrich, J., Mercier, N., Philippe, A., Riedesel, S., Autzen, M., Mittelstrass, D., Gray, H.J., Galharret, J., Colombo, M., Steinbuch, L., Boer, A.d., 2025. Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 1.1.2. https://r-lum.github.io/Luminescence/

See Also

RLum.Data, RLum.Analysis, Risoe.BINfileData

Examples

Run this code

## load example data
data(ExampleData.BINfileData, envir = environment())

## show data
CWOSL.SAR.Data

## add a new field
add_metadata(CWOSL.SAR.Data,
             info_element = "INSTITUTE") <- "Heidelberg University"

## rename a field
rename_metadata(CWOSL.SAR.Data,
                info_element = "INSTITUTE") <- "INSTITUTION"

## replace all LTYPE to RSL
## but only for the first position
replace_metadata(
 object = CWOSL.SAR.Data,
 info_element = "LTYPE",
 subset = (POSITION == 1)) <- "RSL"

## replacing a field with NULL allows to remove that field
replace_metadata(CWOSL.SAR.Data,
                 info_element = "PREVIOUS") <- NULL

## show the modified data
CWOSL.SAR.Data

Run the code above in your browser using DataLab