Created
October 20, 2020 11:36
-
-
Save PMassicotte/3a6f72e9eea4d18405002421977178e3 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment