patterntransform {DAIME} | R Documentation |
Transform patterns between stratigraphic height and time/age
Description
This function (1) takes temporal patterns and determines the corresponding stratigraphic patterns or (2) takes stratigraphic patterns and reconstructs the underlying temporal patterns.
These patterns can for example be rates of (first/last) fossil occurrences, rates of morphological change, or input rates into the sediment, e.g. of geochemical proxies.
Usage
patterntransform ( xdep , ydep , xpat , ypat , direction = 'time to height' ,
depositionmodel = 'piecewise linear deposition rate' , patternmode = 'piecewise linear' ,
pos=NULL , hiatuslist=list() ,unit = 'time per sediment',timetype='time' )
Arguments
xdep |
Vector of strictly increasing real numbers |
ydep |
Vector of real numbers. |
xpat |
Vector of strictly increasing real numbers |
ypat |
Vector containing positive real numbers. |
direction |
OPTIONAL, default is |
depositionmodel |
OPTIONAL, default is |
patternmode |
OPTIONAL, default is |
pos |
OPTIONAL, default is |
hiatuslist |
OPTIONAL, default is an empty list. List of hiatuses to be included into the transformation, only used when |
unit |
OPTIONAL, default is 'sediment per time'. Only used when |
timetype |
OPTIONAL, default is "time". Either "time" or "age", determines whether input/output will be interpreted/given as time or age |
Value
Returns a list with two elements. If direction='time to height'
, these elements are
height |
vector containing stratigraphic heights |
val |
vector containing the values of the stratigraphic pattern (=transformed temporal pattern) at the stratigraphic heights given by |
report |
A short summary of the task performed |
If direction='height to time'
and timetype='time'
, these elements are
time |
vector containing points in time |
val |
vector containing the values of the temporal pattern (=transformed stratigraphic pattern) at the points in time given by |
report |
A short summary of the task performed |
If direction='height to time'
and timetype='age'
, these elements are
age |
vector containing ages |
val |
vector containing the values of the temporal pattern (=transformed stratigraphic pattern) at the ages given by |
report |
A short summary of the task performed |
Output of NA
in age
,time
, height
, or val
indicates that some values coincide with a hiatus or intervals where the deposition model is undefined.
Author(s)
Niklas Hohmann
References
Hohmann, Niklas. 2018. Quantifying the Effects of Changing Deposition Rates and Hiatii on the Stratigraphic Distribution of Fossils. <doi:10.13140/RG.2.2.23372.51841>
See Also
For an overview of the functions in the DAIME package and examples using stratigraphic data see the vignette (available via vignette('DAIME')
)
pointtransform
for the transformation of points
patterntodepositionmodel
to create deposition models based in sedimentary dilution/condensation of known patterns
strattotimeratebin
, strattotimeratecont
, timetostratratebin
, and timetostratratecont
for diverse (outdated) wrappers of patterntransform
.
Examples
### Example 1: transform patterns from time into the section
##define (piecewise linear) deposition rate
my.xdep=seq(0,12,length.out=100)
my.ydep=splinefunH(x=c(0,2,4,6,8,10,12),y=c(1,5,6,1,0.5,1,6),m=c(0,1.5,-0.5,-0.5,0,0.5,0))(my.xdep)
#Plot deposition rate
plot(my.xdep,my.ydep,type='l',main='Deposition Rate',xlab='Time', ylab='Sediment per Time Unit',
ylim=c(0,max(my.ydep)))
##define (piecewise linear) temporal pattern, here fossil occurrences
patternname='Fossil Occurrences'
my.temp.pat.x= seq(from=min(my.xdep),to=max(my.xdep),length.out=100)
my.temp.pat.y=splinefunH(x=c(0,4,12),y=c(0.5,2,0.5),m=c(0,0,0))(my.temp.pat.x)
plot(my.temp.pat.x,my.temp.pat.y,type='l',main=paste(patternname,'in time'),
xlab='Time',ylab=patternname,ylim=c(0,max(my.temp.pat.y)))
##transform temporal pattern into stratigraphic pattern
strat.pat=patterntransform(xdep=my.xdep,ydep=my.ydep,xpat=my.temp.pat.x,ypat=my.temp.pat.y,
direction = 'time to height' , depositionmodel = 'piecewise linear deposition rate' ,
patternmode = 'piecewise linear')
strat.pat$report
my.strat.pat.x=strat.pat$height
my.strat.pat.y=strat.pat$val
plot(my.strat.pat.x,my.strat.pat.y,type='l',xlab='Stratigraphic Height',
ylab=patternname, main=paste(patternname,' in the section'))
## Variation: modify deposition rate to include erosion
my.xdep2=my.xdep
my.ydep2=splinefunH(x=c(0,2,4,6,8,10,12),y=c(1,5,6,-2,5,1,6),m=c(0,1.5,-0.5,-0.5,0,0.5,0))(my.xdep2)
#Plot deposition rate
plot(my.xdep2,my.ydep2,type='l',main='Deposition Rate',xlab='Time',ylab='Sediment per Time Unit')
lines(range(my.xdep2),c(0,0))
strat.pat2=patterntransform(xdep=my.xdep2,ydep=my.ydep2,xpat=my.temp.pat.x,ypat=my.temp.pat.y,
direction = 'time to height' , depositionmodel = 'piecewise linear deposition rate' ,
patternmode = 'piecewise linear')
strat.pat2$report
my.strat.pat.x2=strat.pat2$height
my.strat.pat.y2=strat.pat2$val
plot(my.strat.pat.x2,my.strat.pat.y2,type='l',xlab='Stratigraphic Height',
ylab=patternname,main=paste(patternname,' in the section'),ylim=c(0,1))
#the spike is because the deposition rate is very small when it transitions from
#negative to positive, generating a punctual extreme condensation
### Example 2: Transform patterns from the section into time
patternname='Fossil Occurrences'
#piecewise linear deposition rate
my.xdep=seq(0,12,length.out=100)
my.ydep=splinefunH(x=c(0,2,4,6,8,10,12),y=c(1,5,6,1,0.5,1,6),m=c(0,1.5,-0.5,-0.5,0,0.5,0))(my.xdep)
## Same pattern, this time interpreted as stratigraphic pattern
my.strat.pat.x= seq(from=min(my.xdep),to=max(my.xdep),length.out=100)
my.strat.pat.y=splinefunH(x=c(0,4,12),y=c(0.5,2,0.5),m=c(0,0,0))(my.strat.pat.x)
plot(my.strat.pat.x,my.strat.pat.y,type='l',main=paste(patternname,'in the section'),
xlab='Stratigraphic Height',ylab=patternname,ylim=c(0,max(my.strat.pat.y)))
##interpret deposition rate as inverse deposition rate with the unit "time per sediment"
usedunit='time per sediment'
plot(my.xdep,my.ydep,type='l',main=paste('Deposition Rate as',usedunit),
xlab='Stratigraphic Height',ylab=usedunit,ylim=c(0,max(my.ydep)))
#transform pattern
temp.pat1=patterntransform(xdep=my.xdep,ydep=my.ydep,xpat=my.strat.pat.x,ypat=my.strat.pat.y,
direction = 'height to time' , depositionmodel = 'piecewise linear deposition rate' ,
patternmode = 'piecewise linear', unit=usedunit)
temp.pat1$report
#plot result
plot(temp.pat1$time,temp.pat1$val,type='l',xlab='Time',
ylab=patternname,main=paste(patternname, 'in time'),ylim=c(0,max(temp.pat1$val)))
##take the deposition rate as ordinary deposition rate with unit "sediment per time"
usedunit='sediment per time'
plot(my.xdep,my.ydep,type='l',main=paste('Deposition Rate as',usedunit),
xlab='Stratigraphic Height',ylab=usedunit,ylim=c(0,max(my.ydep)))
#transform pattern
temp.pat2=patterntransform(xdep=my.xdep,ydep=my.ydep,xpat=my.strat.pat.x,ypat=my.strat.pat.y,
direction = 'height to time' ,depositionmodel = 'piecewise linear deposition rate' ,
patternmode = 'piecewise linear', unit=usedunit)
temp.pat2$report
#plot result
plot(temp.pat2$time,temp.pat2$val,type='l',xlab='Time',
ylab=patternname,main=paste(patternname, 'in time'),ylim=c(0,max(temp.pat2$val)))
#Note the big difference in the resulting patterns in time depending on the unit used.