# NOT RUN {
##define deposition rate
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)
#Plot deposition rate
plot(xdep,ydep,type='l',main='Deposition Rate',xlab='Time',ylab='Sediment per Time Unit')
#define a temporal pattern
xsig= seq(0,12,length.out=100)
ysig=splinefunH(x=c(0,4,12),y=c(0.5,2,0.5),m=c(0,0,0))(xsig)
plot(xsig,ysig,type='l',main='Temporal Pattern',xlab='Time',ylab='Intensity')
##transform temporal pattern into stratigraphic pattern (pattern observable in the section)
reslist=timetostratratecont(xdep,ydep,xsig,ysig)
plot(reslist$height,reslist$val,type='l',xlab='Stratigraphic Height',
ylab='Intensity',main='Stratigraphic Pattern')
##with removal of sediment
ydep=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))(xdep)
#Plot deposition rate
plot(xdep,ydep,type='l',main='Deposition Rate',xlab='Time',ylab='Sediment per Time Unit')
reslist=timetostratratecont(xdep,ydep,xsig,ysig)
plot(reslist$height,reslist$val,type='l',xlab='Stratigraphic Height',
ylab='Intensity',main='Stratigraphic Pattern',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
# }
Run the code above in your browser using DataLab