Object class contains results data from functions (e.g., analyse_SAR.CWOSL).

# S4 method for RLum.Results
show(object)

# S4 method for RLum.Results
set_RLum(class, originator, .uid, .pid, data = list(), info = list())

# S4 method for RLum.Results
get_RLum(object, data.object, info.object = NULL, drop = TRUE)

# S4 method for RLum.Results
length_RLum(object)

# S4 method for RLum.Results
names_RLum(object)

Arguments

object

get_RLum; RLum.Results (required): an object of class RLum.Results to be evaluated

class

set_RLum; character (required): name of the RLum class to create

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++ function create_UID.

.pid

set_RLum; character (with default): option to provide a parent id for nesting at will.

data

set_RLum; list (optional): a list containing the data to be stored in the object

info

set_RLum; list (optional): a list containing additional info data for the object

data.object

get_RLum; character or numeric: name or index of the data slot to be returned

info.object

get_RLum; character (optional): name of the wanted info element

drop

get_RLum; logical (with default): coerce to the next possible layer (which are data objects, drop = FALSE keeps the original RLum.Results

Value

set_RLum:

Returns an object from the class RLum.Results

get_RLum:

Returns:

  1. Data object from the specified slot

  2. list of data objects from the slots if 'data.object' is vector or

  3. an RLum.Results for drop = FALSE.

length_RLum

Returns the number of data elements in the RLum.Results object.

names_RLum

Returns the names of the data elements in the object.

Methods (by generic)

  • show(RLum.Results): Show structure of RLum.Results object

  • set_RLum(RLum.Results): Construction method for an RLum.Results object.

  • get_RLum(RLum.Results): Accessor method for RLum.Results object. The argument data.object allows directly accessing objects delivered within the slot data. The default return object depends on the object originator (e.g., fit_LMCurve). If nothing is specified always the first data.object will be returned.

    Note: Detailed specification should be made in combination with the originator slot in the receiving function if results are pipped.

  • length_RLum(RLum.Results): Returns the length of the object, i.e., number of stored data.objects

  • names_RLum(RLum.Results): Returns the names data.objects

Slots

data

Object of class list containing output data

Note

The class is intended to store results from functions to be used by other functions. The data in the object should always be accessed by the method get_RLum.

Objects from the Class

Objects can be created by calls of the form new("RLum.Results", ...).

Class version

0.5.2

Author

Sebastian Kreutzer, Institute of Geography, Heidelberg University (Germany) , RLum Developer Team

How to cite

Kreutzer, S., 2023. RLum.Results-class(): Class 'RLum.Results'. 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., 2023. Luminescence: Comprehensive Luminescence Dating Data Analysis. R package version 0.9.23. https://CRAN.R-project.org/package=Luminescence

Examples


showClass("RLum.Results")
#> Class "RLum.Results" [package "Luminescence"]
#> 
#> Slots:
#>                                                              
#> Name:        data originator       info       .uid       .pid
#> Class:       list  character       list  character  character
#> 
#> Extends: "RLum"

##create an empty object from this class
set_RLum(class = "RLum.Results")
#> 
#>  [RLum.Results-class]
#> 	 originator: eval()
#> 	 data: 0
#>  	 .. $ : list
#> 	 additional info elements:  0 

##use another function to show how it works

##Basic calculation of the dose rate for a specific date
 dose.rate <-  calc_SourceDoseRate(
   measurement.date = "2012-01-27",
   calib.date = "2014-12-19",
   calib.dose.rate = 0.0438,
   calib.error = 0.0019)

##show object
dose.rate
#> 
#>  [RLum.Results-class]
#> 	 originator: calc_SourceDoseRate()
#> 	 data: 3
#>  	 .. $dose.rate : data.frame
#> 	 .. $parameters : list
#> 	 .. $call : call
#> 	 additional info elements:  0 

##get results
get_RLum(dose.rate)
#>    dose.rate dose.rate.error       date
#> 1 0.04695031     0.002036657 2012-01-27

##get parameters used for the calcualtion from the same object
get_RLum(dose.rate, data.object = "parameters")
#> $source.type
#> [1] "Sr-90"
#> 
#> $halflife
#> [1] 28.9
#> 
#> $dose.rate.unit
#> [1] "Gy/s"
#> 

##alternatively objects can be accessed using S3 generics, such as
dose.rate$parameters
#> $source.type
#> [1] "Sr-90"
#> 
#> $halflife
#> [1] 28.9
#> 
#> $dose.rate.unit
#> [1] "Gy/s"
#>