# NOT RUN {
##define deposition rate and stratigraphic pattern
xdep=seq(0,12,length.out=100)
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))(xdep)
usedunit="sediment per time" #unit of deposition rate is sediment per time unit (default setting)
#Plot deposition rate
plot(xdep,ydep,type='l',main='Deposition Rate',xlab='Stratigraphic Height',
ylab=usedunit)
#define a pattern
xsig= seq(from=min(xdep),to=max(xdep),length.out=100)
ysig=splinefunH(x=c(0,4,12),y=c(0.5,2,0.5),m=c(0,0,0))(xsig) #function values of the signal
plot(xsig,ysig,type='l',main='Stratigraphic Pattern',
xlab='Stratigraphic Height',ylab='Intensity')
##transform stratigraphic pattern into temporal pattern
usedunit="sediment per time" #unit of deposition rate is sediment per time unit (default setting)
reslist=strattotimeratecont(xdep,ydep,xsig,ysig,unit=usedunit)
#plot temporal pattern (transformed stratigrapic pattern)
plot(reslist$age,reslist$val,type='l',xlab='Time',ylab='Intensity',
main=paste('deposition rate interpreted as',usedunit))
#now using same input, but different interpretation of units
usedunit="time per sediment" #now interpret the deposition rate in different units
reslist=strattotimeratecont(xdep,ydep,xsig,ysig,unit=usedunit)
#plot temporal pattern (transformed stratigrapic pattern)
plot(reslist$age,reslist$val,type='l',xlab='Time',ylab='Intensity temporal pattern',
main=paste('deposition rate interpreted as',usedunit))
#note how different the results look!!
#Insert hiatus
stratigraphicheight=5 #strat. height of the hiatus
duration=4 #duration of the hiatus
hiatuslist=list(c(stratigraphicheight,duration)) #required input format for hiatuses
reslist=strattotimeratecont(xdep,ydep,xsig,ysig,hiatuslist=hiatuslist) #unit is back to default
plot(reslist$age,reslist$val,xlab='Time',ylab='Intensity',main='Temporal Pattern')
#hiatus is approx between 2 and 5
# }
Run the code above in your browser using DataLab