OpenDendro / dplR

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

Error in sea() from quantile.default with NaNs #12

Closed csavoldelli closed 2 years ago

csavoldelli commented 2 years ago

Hi Andy,

This is my first issue report on GitHub so apologies if I do things wrong!

I have a small sample (43 series) that cover ~150 years, but the majority of the sample depth starts in the last 100. I'm attempting to run the sea() function to evaluate ~5 storm event years. The code worked some days ago, but now I get the error below. Unfortunately I'm quite new to R and even looking at the function's code I couldn't tell where setting na.rm to TRUE might help, or if there is something wrong with my data.

grow.sea <- sea(grow.rwi, event.years, lag = 5, resample = 1000) Error in quantile.default(newX[, i], ...) : missing values and NaN's not allowed if 'na.rm' is FALSE

The preceding and following code is nearly identical to the example given here, but happy to provide further context. Thank you either way for this great package!

Carolyn

AndyBunn commented 2 years ago

Hi Carolyn. Probably best if you email me the file and the R script you are using unless you can produce a minimal reproducible example of the error. Happy to look into it.

csavoldelli commented 2 years ago

Hi Andy - thank you so much for your offer! Very simple error on my part, apologies for taking your time. I was running the function on an rwi rather than a detrended chronology. Works well with the latter.

AndyBunn commented 2 years ago

No worries!

From: csavoldelli @.> Date: Monday, May 2, 2022 at 3:17 PM To: AndyBunn/dplR @.> Cc: Andy Bunn @.>, Comment @.> Subject: Re: [AndyBunn/dplR] Error in sea() from quantile.default with NaNs (Issue #12)

Hi Andy - thank you so much for your offer! Very simple error on my part, apologies for taking your time. I was running the function on an rwi rather than a detrended chronology. Works well with the latter.

— Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAndyBunn%2FdplR%2Fissues%2F12%23issuecomment-1115424768&data=05%7C01%7Cbunna%40wwu.edu%7Ced7d4c3fa6e845be695b08da2c898954%7Cdc46140ce26f43efb0ae00f257f478ff%7C0%7C0%7C637871266481816140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=w6sm%2Fkw%2Fa5uH%2B9AvWzn97RJQmXFUYbFIaoF8b0NLkgM%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC7UCXI3R4QDDIMWXL62UTLVIBH7JANCNFSM5USMVIDQ&data=05%7C01%7Cbunna%40wwu.edu%7Ced7d4c3fa6e845be695b08da2c898954%7Cdc46140ce26f43efb0ae00f257f478ff%7C0%7C0%7C637871266481816140%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=90EtqjtQkrffM4Ia0jDN1rYRJkyeh8%2F%2BUnJzgsLSm4k%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>