Skip to content

Commit

Permalink
Replaced tidyr::separate with tidytable::separate to increase speed
Browse files Browse the repository at this point in the history
  • Loading branch information
hahsan1 committed Mar 20, 2024
1 parent a9f92b2 commit eb7744b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Imports:
sf,
purrr,
ggplot2,
stringi
stringi,
tidytable
Suggests:
rmarkdown,
testthat (>= 3.0.0),
Expand Down
2 changes: 1 addition & 1 deletion R/calculate_deltas_from_climate.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ calculate_deltas_from_climate <- function(climate_dir = NULL,
x <- cbind(grid, x1, x2) %>%
dplyr::select(unique(colnames(.))) %>%
tidyr::gather(time, value, -lon, -lat) %>%
tidyr::separate(time, into = c('month', 'year'), sep = '~') %>%
tidytable::separate(col = time, into = c('month', 'year'), sep = '~') %>%
dplyr::mutate(year = as.integer(year),
month=as.integer(month)) %>%
dplyr::filter(year >= 1965)
Expand Down

0 comments on commit eb7744b

Please sign in to comment.