Skip to content

Commit

Permalink
fixed count_gaps() warning due to dplyr change
Browse files Browse the repository at this point in the history
closes #295
  • Loading branch information
earowang committed Jan 24, 2024
1 parent 5f23d9b commit 3d907de
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Depends:
R (>= 3.2.0)
Imports:
anytime (>= 0.3.1),
dplyr (>= 1.0.0),
dplyr (>= 1.1.0),
ellipsis (>= 0.3.0),
generics,
lifecycle,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ importFrom(dplyr,left_join)
importFrom(dplyr,mutate)
importFrom(dplyr,new_grouped_df)
importFrom(dplyr,pull)
importFrom(dplyr,reframe)
importFrom(dplyr,rename)
importFrom(dplyr,right_join)
importFrom(dplyr,select)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# tsibble 1.1.4

* Fixed `vec_ptype2()` for `yearweek` and `yearquarter` for non-default week start. (#299)
* Fixed `count_gaps()` warning message due to dplyr deprecation in favour of `reframe()`. (#295)

# tsibble 1.1.3

Expand Down
4 changes: 2 additions & 2 deletions R/gaps.R
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ count_gaps <- function(.data, .full = FALSE, .name = c(".from", ".to", ".n"),

idx_full <- seq_generator(.data[[as_string(idx)]], int)
grped_tbl <- new_grouped_df(gap_data, groups = key_data(gap_data))
lst_out <- summarise(grped_tbl,
lst_out <- reframe(grped_tbl,
!!".gaps" := tbl_gaps(!!idx, idx_full, .name = .name))

vec_cbind(lst_out[key_vars(.data)], vec_cbind(!!!lst_out$.gaps))
Expand Down Expand Up @@ -342,7 +342,7 @@ seq_generator <- function(x, time_units = NULL, length_out = NULL) {
if (time_units == 0) return(x)

min_x <- min(x)
seq_call <- quote(seq(from = min_x, to = max(x), by = time_units,
seq_call <- quote(seq(from = min_x, to = max(x), by = time_units,
length.out = length_out))
if (!is.null(length_out)) {
seq_call <- call_modify(seq_call, to = zap())
Expand Down
2 changes: 1 addition & 1 deletion R/tsibble-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
#' @importFrom dplyr group_by ungroup group_data grouped_df group_vars
#' @importFrom dplyr group_rows groups new_grouped_df is_grouped_df
#' @importFrom dplyr left_join right_join full_join inner_join anti_join
#' @importFrom dplyr bind_rows bind_cols combine with_order pull first
#' @importFrom dplyr bind_rows bind_cols combine with_order pull first reframe
#' @importFrom dplyr dplyr_row_slice dplyr_col_modify dplyr_reconstruct
#' @importFrom tibble new_tibble trunc_mat
#' @import rlang tidyselect vctrs ellipsis
Expand Down

0 comments on commit 3d907de

Please sign in to comment.