OpenDendro / dplR

This is the dev site for the dplR package in R
37 stars 14 forks source link

chron.stabilized not producing output of class crn #18

Closed istvan60 closed 1 year ago

istvan60 commented 1 year ago

Dear Andy!

I ran into what I think is a bug. The chron() run on the detrended Bakta.rwl works fine and produces an output of crn class, but the chron.stabilized() does not. The structure of the two outputs is the same, there is just a difference in class, so I cannot produce the crn.plot().

kép

Could you please take a look at it? Please find the .rwl data attached

Bakta= read.rwl("Bakta.rwl")

outputGHP_std=detrend(rwl=Bakta, make.plot = T, method = c("Spline"),nyrs = 100, f = 0.5, 
                      pos.slope = FALSE, verbose = T, return.info = F, difference = T)

outputGHP_std_chron_stab<-chron.stabilized(outputGHP_std, winLength=51, biweight = TRUE, running.rbar = F)
outputGHP_std_chron_simple<-chron(outputGHP_std)

crn.plot(outputGHP_std_chron_stab)
crn.plot(outputGHP_std_chron_simple)

Bakta.zip

Thank you very much!

istvan60 commented 1 year ago

It seems that

class(outputGHP_std_chron_stab) <- c("crn", "data.frame")

does the trick, however, I had to do this manually and this line seems to be missing from the function.

AndyBunn commented 1 year ago

Great. I'm adding that class addition to the function in the dev version. Appreciate the spot.