# NOT RUN {
data(return)
x<-return[1,]
##if we kept everything as default, before you use this function, you need to know the
## temporal resolution of waveform, default is 1 ns.
##for one peak, it generaly not make too much sense since generally only ground was
##present in this case.
r1<-integral(x)
#if you didn't want to smooth,
r2<-integral(x,smooth=FALSE)
##you also can define the boundary between vegetation and ground by assign adjusting dis
#if we assign 15, it means vegetation starts at 2.25 (15*1*0.15) m above the last echo.
r3<-integral(x,dis=15)
# when it comes to the waveform with several peaks
xx<-return[182,]
rr1<-integral(xx)
# }
Run the code above in your browser using DataLab