Learn R Programming

Luminescence (version 1.0.0)

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

Arguments

object

(required) object to manipulate

...

further arguments passed to the specific class method

value

the value to be assigned

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.0.0. 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