# NOT RUN {
## Define deposition rate
binborder=1:6 #temporal bins for the deposition rate
depoval=c(5,4,3,1,2) #deposition rate in the bins
#plot deposition rate
depositionrate=approxfun(binborder,c(depoval,tail(depoval,1)),method="constant",yleft=NA,yright=NA)
plot(depositionrate(seq(from=min(binborder),to=max(binborder),length.out=100)),xlab='time',
ylab='deposition rate', main='Deposition rate')
## Define temporal pattern
signalval=c(1,0,5,2,1)
#plot temporal pattern
temporalpat=approxfun(binborder,c(signalval,tail(signalval,1)),method="constant",
yleft=NA,yright=NA)
plot(temporalpat(seq(from=min(binborder),to=max(binborder),length.out=100)),xlab='time',
ylab='Intensity', main='Temporal Pattern')
## Transform temporal pattern into stratigraphic pattern
reslist=timetostratratebin(binborder,depoval,signalval)
#plot resulting stratigraphic pattern
plot(reslist$height,reslist$val,xlab='Stratigraphic Height',ylab='Intensity',
main='Stratigraphic Pattern')
## With removal of sediment (hiatus)
depoval=c(5,4,-3,1,2) #erosion rate is 3 in the middle time bin
reslist=timetostratratebin(binborder,depoval,signalval)
#plot resulting stratigraphic pattern
plot(reslist$height,reslist$val,xlab='Stratigraphic Height',ylab='Intensity',
main='Stratigraphic Pattern')
# }
Run the code above in your browser using DataLab