Mm, that's an interesting package—someone wrapped an existing C library. That could be tricky to debug. If you want to use it, I'd suggest getting in touch with the package author (maybe file an issue?)
One thing I notice, quickly scanning the wrapper code, is that it does some error checking on pressure:
out[pres > 2000 | pres < 800] <- NA
I would be checking what units the code expects for pressure—particularly if the authors are US-based. If you're feeding in mm of mercury and they're expecting hectopascals or kilopascals (or vice-versa), that could lead to a heap of
Honestly, you might just find it easier to do yourself in R—I've calculated sWBGT (a simplified version that assumes sunny conditions) in R on tens of thousands of rows without a problem. It only requires element-wise operations (adding different columns directly across rows), so R will handle it fine.
One gotcha when I do daily aggregations of WBGT (eg. daily max WBGT), I often forget the
na.rm = TRUE argument in aggregation functions like
max. So if you give them data with any missing values, the whole thing comes out
NA, and then I wonder why I have so many
NAs in my output
Hope that helps!