Created
October 20, 2020 11:37
-
-
Save PMassicotte/7f43284a80fac9e8fd7093656cde4020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctd | |
tic() | |
ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ zoo::rollmedian(.x, k = 11, fill = NA, align = "center"), | |
.names = "{.col}_rollmedian" | |
)) | |
toc() | |
tic() | |
ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ RcppRoll::roll_median(.x, n = 11, fill = NA, align = "center"), | |
.names = "{.col}_rollmedian" | |
)) | |
toc() | |
# https://git.io/JTREr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment