data(Brumbaugh)
#Artifical time and season variables for demonstration purposes
Brumbaugh$time=1:nrow(Brumbaugh)
Brumbaugh$sea=as.factor(round(runif(nrow(Brumbaugh),1,4),0))
with(Brumbaugh,computeS(time,Hg,HgCen,sea,R=100))
Run the code above in your browser using DataLab