boshek / rsoi

Import Climate Indices into R
https://boshek.github.io/rsoi/
18 stars 5 forks source link

Adds `NA` to ONI month window at the extremes. #26

Closed eliocamp closed 4 years ago

eliocamp commented 4 years ago

The last row of ONI_month_window fails because there is no "next month".

library(rsoi)
tail(download_oni())
#>           Date Month Year dSST3.4       ONI ONI_month_window
#> 834 2019-06-01   jun 2019    0.54 0.5266667              mjj
#> 835 2019-07-01   jul 2019    0.39 0.3100000              jja
#> 836 2019-08-01   ago 2019    0.00 0.1200000              jas
#> 837 2019-09-01   sep 2019   -0.03 0.1433333              aso
#> 838 2019-10-01   oct 2019    0.46 0.3033333              son
#> 839 2019-11-01   nov 2019    0.48        NA             onNA
#>                  phase
#> 834 Warm Phase/El Nino
#> 835      Neutral Phase
#> 836      Neutral Phase
#> 837      Neutral Phase
#> 838      Neutral Phase
#> 839               <NA>

Created on 2019-12-04 by the reprex package (v0.3.0)

This PR replaces the first and last row of that column with NA, which I think is pretty reasonable.

(Sorry for the rapid fire PRs but you're being victimised by my procrastinating from my actual work 😅️)

codecov-io commented 4 years ago

Codecov Report

Merging #26 into master will increase coverage by 15.31%. The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #26       +/-   ##
===========================================
+ Coverage    5.47%   20.79%   +15.31%     
===========================================
  Files           8        8               
  Lines         201      202        +1     
===========================================
+ Hits           11       42       +31     
+ Misses        190      160       -30
Impacted Files Coverage Δ
R/download-oni.R 79.31% <100%> (+79.31%) :arrow_up:
R/download-ao.R 0% <0%> (ø) :arrow_up:
R/utils.R 73.07% <0%> (+30.76%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update ccd9516...8f64994. Read the comment docs.

boshek commented 4 years ago

@eliocamp Love the rapid fire PRs!

boshek commented 4 years ago

Ignoring the mac failure as it is actually a LaTeX issue