-
Notifications
You must be signed in to change notification settings - Fork 8
/
RLum.Data.Curve-class.Rd
207 lines (154 loc) · 7.14 KB
/
RLum.Data.Curve-class.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RLum.Data.Curve-class.R
\docType{class}
\name{RLum.Data.Curve-class}
\alias{RLum.Data.Curve-class}
\alias{show,RLum.Data.Curve-method}
\alias{set_RLum,RLum.Data.Curve-method}
\alias{get_RLum,RLum.Data.Curve-method}
\alias{length_RLum,RLum.Data.Curve-method}
\alias{names_RLum,RLum.Data.Curve-method}
\alias{bin_RLum.Data,RLum.Data.Curve-method}
\alias{smooth_RLum,RLum.Data.Curve-method}
\alias{melt_RLum,RLum.Data.Curve-method}
\title{Class \code{"RLum.Data.Curve"}}
\usage{
\S4method{show}{RLum.Data.Curve}(object)
\S4method{set_RLum}{RLum.Data.Curve}(
class,
originator,
.uid,
.pid,
recordType = NA_character_,
curveType = NA_character_,
data = matrix(0, ncol = 2),
info = list()
)
\S4method{get_RLum}{RLum.Data.Curve}(object, info.object = NULL)
\S4method{length_RLum}{RLum.Data.Curve}(object)
\S4method{names_RLum}{RLum.Data.Curve}(object)
\S4method{bin_RLum.Data}{RLum.Data.Curve}(object, bin_size = 2)
\S4method{smooth_RLum}{RLum.Data.Curve}(object, k = NULL, fill = NA, align = "right", method = "mean")
\S4method{melt_RLum}{RLum.Data.Curve}(object)
}
\arguments{
\item{object}{\code{\link{get_RLum}}, \code{\link{length_RLum}}, \code{\link{names_RLum}} (\strong{required}):
an object of class \linkS4class{RLum.Data.Curve}}
\item{class}{\code{\link{set_RLum}}; \link{character} (\strong{required}):
name of the \code{RLum} class to create}
\item{originator}{\code{\link{set_RLum}}; \link{character} (\emph{automatic}):
contains the name of the calling function (the function that produces this object);
can be set manually.}
\item{.uid}{\code{\link{set_RLum}}; \link{character} (\emph{automatic}):
sets an unique ID for this object using the internal C++ function \code{create_UID}.}
\item{.pid}{\code{\link{set_RLum}}; \link{character} (\emph{with default}):
option to provide a parent id for nesting at will.}
\item{recordType}{\code{\link{set_RLum}}; \link{character} (\emph{optional}):
record type (e.g., "OSL")}
\item{curveType}{\code{\link{set_RLum}}; \link{character} (\emph{optional}):
curve type (e.g., "predefined" or "measured")}
\item{data}{\code{\link{set_RLum}}; \link{matrix} (\strong{required}):
raw curve data. If \code{data} itself is a \code{RLum.Data.Curve}-object this can be
used to re-construct the object (s. details), i.e. modified parameters except
\code{.uid}, \code{.pid} and \code{originator}. The rest will be subject to copy and paste unless provided.}
\item{info}{\code{\link{set_RLum}}; \link{list} (\emph{optional}):
info elements}
\item{info.object}{\code{\link{get_RLum}} \link{character} (\emph{optional}):
name of the wanted info element}
\item{bin_size}{\link{integer} (\emph{with default}):
set number of channels used for each bin, e.g. \code{bin_size = 2} means that
two channels are binned.}
\item{k}{\code{\link{smooth_RLum}}; \link{integer} (\emph{with default}):
window for the rolling mean; must be odd for \code{rollmedian}.
If nothing is set k is set automatically}
\item{fill}{\code{\link{smooth_RLum}}; \link{numeric} (\emph{with default}):
a vector defining the left and the right hand data}
\item{align}{\code{\link{smooth_RLum}}; \link{character} (\emph{with default}):
specifying whether the index of the result should be left- or right-aligned
or centred (default) compared to the rolling window of observations, allowed
\code{"right"}, \code{"center"} and \code{"left"}}
\item{method}{\code{\link{smooth_RLum}}; \link{character} (\emph{with default}):
defines which method should be applied for the smoothing: \code{"mean"} or \code{"median"}}
}
\value{
\strong{\code{set_RLum}}
Returns an \linkS4class{RLum.Data.Curve} object.
\strong{\code{get_RLum}}
\enumerate{
\item A \link{matrix} with the curve values or
\item only the info object if \code{info.object} was set.
}
\strong{\code{length_RLum}}
Number of channels in the curve (row number of the matrix)
\strong{\code{names_RLum}}
Names of the info elements (slot \code{info})
\strong{\code{bin_RLum.Data}}
Same object as input, after applying the binning.
\strong{\code{smooth_RLum}}
Same object as input, after smoothing
\strong{\code{melt_RLum}}
Flat \link{data.frame} with \code{X}, \code{Y}, \code{TYPE}, \code{UID}
}
\description{
Class for representing luminescence curve data.
}
\section{Methods (by generic)}{
\itemize{
\item \code{show(RLum.Data.Curve)}: Show structure of \code{RLum.Data.Curve} object
\item \code{set_RLum(RLum.Data.Curve)}: Construction method for RLum.Data.Curve object. The slot info is optional
and predefined as empty list by default.
\item \code{get_RLum(RLum.Data.Curve)}: Accessor method for RLum.Data.Curve object. The argument info.object is
optional to directly access the info elements. If no info element name is
provided, the raw curve data (matrix) will be returned.
\item \code{length_RLum(RLum.Data.Curve)}: Returns the length of the curve object, which is the maximum of the
value time/temperature of the curve (corresponding to the stimulation length)
\item \code{names_RLum(RLum.Data.Curve)}: Returns the names info elements coming along with this curve object
\item \code{bin_RLum.Data(RLum.Data.Curve)}: Allows binning of specific objects
\item \code{smooth_RLum(RLum.Data.Curve)}: Smoothing of RLum.Data.Curve objects using a rolling mean or median.
In particular the internal function \code{.smoothing} is used.
\item \code{melt_RLum(RLum.Data.Curve)}: Melts \linkS4class{RLum.Data.Curve} objects into a flat data.frame to be used
in combination with other packages such as \code{ggplot2}.
}}
\section{Slots}{
\describe{
\item{\code{recordType}}{Object of class "character" containing the type of the curve (e.g. "TL" or "OSL")}
\item{\code{curveType}}{Object of class "character" containing curve type, allowed values are
"measured" or "predefined"}
\item{\code{data}}{Object of class \link{matrix} containing curve x and y data.
'data' can also be of type \code{RLum.Data.Curve} to change object values without
de-constructing the object. For example:
\if{html}{\out{<div class="sourceCode">}}\preformatted{set_RLum(class = 'RLum.Data.Curve',
data = Your.RLum.Data.Curve,
recordType = 'never seen before')
}\if{html}{\out{</div>}}
would just change the \code{recordType}. Missing arguments the value is taken
from the input object in 'data' (which is already an \code{RLum.Data.Curve}
object in this example)}
}}
\note{
The class should only contain data for a single curve. For additional
elements the slot \code{info} can be used (e.g. providing additional heating
ramp curve). Objects from the class \code{RLum.Data.Curve} are produced by other
functions (partly within \linkS4class{RLum.Analysis} objects),
namely: \link{Risoe.BINfileData2RLum.Analysis}, \link{read_XSYG2R}
}
\section{Create objects from this Class}{
Objects can be created by calls of the form
\code{set_RLum(class = "RLum.Data.Curve", ...)}.
}
\section{Class version}{
0.5.1
}
\examples{
showClass("RLum.Data.Curve")
##set empty curve object
set_RLum(class = "RLum.Data.Curve")
}
\seealso{
\linkS4class{RLum}, \linkS4class{RLum.Data}, \link{plot_RLum}, \link{merge_RLum}
}
\author{
Sebastian Kreutzer, Institute of Geography, Heidelberg University (Germany)
}
\keyword{classes}
\keyword{internal}