Created
October 20, 2020 11:50
-
-
Save PMassicotte/dba24992e40fa06dd370151bcfd3ec2c 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 <- ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) | |
ctd | |
tic() | |
res <- ctd %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ zoo::rollmedian(.x, k = 11, fill = NA, align = "center"), | |
.names = "{.col}_rollmedian" | |
)) | |
toc() | |
tic() | |
res <- ctd %>% | |
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