Object class to represent analysis data for protocol analysis, i.e. all curves, spectra etc. from one measurements. Objects from this class are produced, by e.g. read_XSYG2R, read_Daybreak2R
Usage
# S4 method for class 'RLum.Analysis'
show(object)
# S4 method for class 'RLum.Analysis'
set_RLum(
class,
originator,
.uid,
.pid,
protocol = NA_character_,
records = list(),
info = list()
)
# S4 method for class 'RLum.Analysis'
get_RLum(
object,
record.id = NULL,
recordType = NULL,
curveType = NULL,
RLum.type = NULL,
protocol = "UNKNOWN",
get.index = NULL,
drop = TRUE,
recursive = TRUE,
info.object = NULL,
subset = NULL,
env = parent.frame(2)
)
# S4 method for class 'RLum.Analysis'
structure_RLum(object, fullExtent = FALSE)
# S4 method for class 'RLum.Analysis'
length_RLum(object)
# S4 method for class 'RLum.Analysis'
names_RLum(object)
# S4 method for class 'RLum.Analysis'
add_metadata(object, info_element) <- value
# S4 method for class 'RLum.Analysis'
rename_metadata(object, info_element) <- value
# S4 method for class 'RLum.Analysis'
replace_metadata(object, info_element, subset = NULL) <- value
# S4 method for class 'RLum.Analysis'
smooth_RLum(object, ...)
# S4 method for class 'RLum.Analysis'
sort_RLum(object, slot = NULL, info_element = NULL, decreasing = FALSE, ...)
# S4 method for class 'RLum.Analysis'
melt_RLum(object)
# S4 method for class 'RLum.Analysis'
view(object, ...)
Arguments
- object
(required): an object of class RLum.Analysis
- class
set_RLum
character (required): name of theRLum
class to be created- originator
set_RLum
character (automatic): contains the name of the calling function (the function that produces this object); can be set manually.- .uid
set_RLum
character (automatic): sets an unique ID for this object using the internal C++ functioncreate_UID
.- .pid
set_RLum
character (with default): option to provide a parent id for nesting at will.- protocol
set_RLum
character (optional): sets protocol type for analysis object. Value may be used by subsequent analysis functions.- records
- info
set_RLum
list (optional): a list containing additional info data for the objectset_RLum
:Returns an RLum.Analysis object.
- record.id
get_RLum
: numeric or logical (optional): IDs of specific records. If of typelogical
the entire id range is assumed andTRUE
andFALSE
indicates the selection.- recordType
get_RLum
: character (optional): record type (e.g., "OSL"). Can be also a vector, for multiple matching, e.g.,recordType = c("OSL", "IRSL")
- curveType
get_RLum
: character (optional): curve type (e.g. "predefined" or "measured")- RLum.type
get_RLum
: character (optional): RLum object type. Defaults to "RLum.Data.Curve" and "RLum.Data.Spectrum".- get.index
get_RLum
: logical (optional): return a numeric vector with the index of each element in the RLum.Analysis object.- drop
get_RLum
: logical (with default): coerce to the next possible layer (which areRLum.Data
-objects),drop = FALSE
keeps the originalRLum.Analysis
- recursive
get_RLum
: logical (with default): ifTRUE
(default) when the result of theget_RLum()
request is a single object, the object itself will be returned directly, rather than being wrapped in a list. Mostly this makes things easier, but this might be undesired if this method is used within a loop.- info.object
get_RLum
: character (optional): name of the wanted info element- subset
get_RLum
: expression (optional): logical expression indicating elements or rows to keep: missing values are taken as false. This argument takes precedence over all other arguments, meaning they are not considered when subsetting the object.- env
get_RLum
: environment (with default): An environment passed to eval as the enclosure. This argument is only relevant when subsetting the object and should not be used manually.- fullExtent
structure_RLum; logical (with default): extends the returned
data.frame
to its full extent, i.e. all info elements are part of the return as well. The default value isFALSE
as the data frame might become rather big.- info_element
character (optional): name of the
info
field to use in sorting.- value
(required) The value assigned to the selected elements of the metadata field. If
NULL
the elements named ininfo_element
will be removed.- ...
other arguments that might be passed
- slot
character (optional): slot name to use in sorting.
- decreasing
logical (with default): whether the sort order should be decreasing (
FALSE
by default).
Value
get_RLum
:
Returns:
Single RLum.Data object, if only one object is contained and
recursive = FALSE
orRLum.Analysis objects for
drop = FALSE
structure_RLum
:
Returns data.frame showing the structure.
length_RLum
Returns the number records in this object.
names_RLum
Returns the names of the record types (recordType
) in this object.
smooth_RLum
Same object as input, after smoothing
sort_RLum
Same object as input, but sorted according to the specified parameters.
melt_RLum
Flat data.frame with X
, Y
, TYPE
, UID
Methods (by generic)
show(RLum.Analysis)
: Show structure ofRLum.Analysis
objectset_RLum(RLum.Analysis)
: Construction method for RLum.Analysis objects.get_RLum(RLum.Analysis)
: Accessor method for RLum.Analysis object.The slots record.id,
@recordType
,@curveType
and@RLum.type
are optional to allow for records limited by their id (list index number), their record type (e.g.recordType = "OSL"
) or object type.Example: curve type (e.g.
curveType = "predefined"
orcurveType ="measured"
)The selection of a specific RLum.type object superimposes the default selection. Currently supported objects are: RLum.Data.Curve and RLum.Data.Spectrum
structure_RLum(RLum.Analysis)
: Method to show the structure of an RLum.Analysis object.length_RLum(RLum.Analysis)
: Returns the length of the object, i.e., number of stored records.names_RLum(RLum.Analysis)
: Returns the names of the RLum.Data objects (same as shown with theshow
method)add_metadata(RLum.Analysis) <- value
: Adds metadata to RLum.Analysis objectsrename_metadata(RLum.Analysis) <- value
: Renames a metadata entry of RLum.Analysis objectsreplace_metadata(RLum.Analysis) <- value
: Replaces or removes metadata of RLum.Analysis objectssmooth_RLum(RLum.Analysis)
: Smoothing ofRLum.Data
objects contained in thisRLum.Analysis
object using the internal function.smoothing
.sort_RLum(RLum.Analysis)
: Sorting ofRLum.Data
objects contained in thisRLum.Analysis
object. At least one ofslot
andinfo_element
must be provided. If both are given, ordering byslot
always supersedes ordering byinfo_element
.melt_RLum(RLum.Analysis)
: Melts RLum.Analysis objects into a flat data.frame to be used in combination with other packages such asggplot2
.view(RLum.Analysis)
: View method for RLum.Analysis objects
Note
The method structure_RLum is currently just available for objects containing RLum.Data.Curve.
Author
Sebastian Kreutzer, Institute of Geography, Heidelberg University (Germany) , RLum Developer Team
How to cite
Kreutzer, S., 2025. RLum.Analysis-class(): Class 'RLum.Analysis'. 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.1. https://r-lum.github.io/Luminescence/
Examples
showClass("RLum.Analysis")
#> Class "RLum.Analysis" [package "Luminescence"]
#>
#> Slots:
#>
#> Name: protocol records originator info .uid .pid
#> Class: character list character list character character
#>
#> Extends: "RLum"
##set empty object
set_RLum(class = "RLum.Analysis")
#>
#> [RLum.Analysis-class]
#> originator: eval()
#> protocol: NA
#> additional info elements: 0
#> number of records: 0
#> >> This is an empty object, which cannot be used for further analysis! <<
###use example data
##load data
data(ExampleData.RLum.Analysis, envir = environment())
##show curves in object
get_RLum(IRSAR.RF.Data)
#> [[1]]
#>
#> [RLum.Data.Curve-class]
#> recordType: RF
#> curveType: NA
#> measured values: 5
#> .. range of x-values: 0.1747448 6.311132
#> .. range of y-values: 1423.15 1437.8
#> additional info elements: 0
#>
#> [[2]]
#>
#> [RLum.Data.Curve-class]
#> recordType: RF
#> curveType: NA
#> measured values: 524
#> .. range of x-values: 0.3768403 715.4821
#> .. range of y-values: 1379.947 2103.4
#> additional info elements: 0
#>
##show only the first object, but by keeping the object
get_RLum(IRSAR.RF.Data, record.id = 1, drop = FALSE)
#>
#> [RLum.Analysis-class]
#> originator: NA()
#> protocol: IRSAR
#> additional info elements: 0
#> number of records: 1
#> .. : RLum.Data.Curve : 1
#> .. .. : #1 RF