boshek / rsoi

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

Adds asymmetric and symmetric SAM #48

Closed eliocamp closed 10 months ago

eliocamp commented 10 months ago

This adds the asymmetric and symmetric SAM indices.

I called the functions "asymsam", from "asymmeric SAM", but let me know if you want me to change them.

library(rsoi)

download_asymsam_monthly() |> 
  head()
#>   Lev Index       Date       Value Value_normalized
#> 1   1   sam 2023-09-01  0.05177943       0.14952028
#> 2   1  ssam 2023-09-01  0.43155471       0.06490490
#> 3   1  asam 2023-09-01 -0.37977528       0.21935814
#> 4   2   sam 2023-09-01  0.04575554       0.22199278
#> 5   2  ssam 2023-09-01  0.54510591       0.09215533
#> 6   2  asam 2023-09-01 -0.49935037       0.24345311

download_asymsam_daily(levels = c(700, 500)) |> 
  head()
#> Downloading level: 700
#> Downloading level: 500
#>   Lev Index       Date       Value    R.squared
#> 1 700  asam 1940-01-01 -0.13508871 0.0426478529
#> 2 700   sam 1940-01-01 -0.12471444 0.0054371573
#> 3 700  ssam 1940-01-01  0.01037427 0.0000442406
#> 4 700  asam 1940-01-02 -0.11471232 0.0345327849
#> 5 700   sam 1940-01-02  0.02685265 0.0002830512
#> 6 700  ssam 1940-01-02  0.14156497 0.0092506011

Created on 2023-10-30 with reprex v2.0.2

BTW: tests fail due to an issue in another function.

Closes #47

boshek commented 10 months ago

Fixed up the actions in #49 & #50 - do you mind rebasing to see if that surfaces anything here?

eliocamp commented 10 months ago

watch me diff, watch me rebase

This seems to solve the issues. (there's a note that in abbr_month class(date) != "Date" should be inherits(date, "Date") , but that can be another PR.

boshek commented 10 months ago

Hmm.... something seems to have gone awry here. I don't understand why the diff is looking like you updated the workflows when those are already updated on master. I see that you merged rather than rebased (no problem!) but I just uncertain why the diff is the way it is.

One last thing to potentially clean up: https://github.com/boshek/rsoi/actions/runs/6712731571/job/18242885434?pr=48#step:6:103 <- do you know why this is showing up?

eliocamp commented 10 months ago

Hmm.... something seems to have gone awry here. I don't understand why the diff is looking like you updated the workflows when those are already updated on master. I see that you merged rather than rebased (no problem!) but I just uncertain why the diff is the way it is.

I'm the wrong person to ask why anything is the way it is in git, honestly. I created a new branch with cleaner diffs and send a new PR: #51

One last thing to potentially clean up: https://github.com/boshek/rsoi/actions/runs/6712731571/job/18242885434?pr=48#step:6:103 <- do you know why this is showing up?

Oops. Yeah, I seem to have forgotten to update the .Rd files. Now fixed on the other PR.