davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
305 stars 113 forks source link

Prefer `is.null()` (and `is.na()`) over `missing()` #354

Closed jack-davison closed 1 year ago

jack-davison commented 1 year ago

This PR aims to fix #353.

In short, it implements a preference for is.na() and is.null() over missing() for several arguments in directional analysis functions.

Previously, one couldn't recreate the default behaviour of functions like polarFreq() while still passing an argument to, e.g., breaks.

For example, polarFreq(mydata, breaks = ...). There was nothing that could be passed to breaks to recreate the default behaviour. This made it difficult to program with polarFreq() (e.g., in openairmaps::freqMap()). There is a more complete example in #353.

This PR fixes this issue. Effort has been made to make the fix back-compatible with previous versions of {openair}.

davidcarslaw commented 1 year ago

Thanks!