Skip to content

Commit

Permalink
attempting to resolve method consistency warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuzana Love committed Apr 7, 2024
1 parent c1203dc commit bf1f81a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Expand Up @@ -48,7 +48,7 @@ Suggests:
ggplot2
VignetteBuilder: knitr
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
Collate:
'class-AnchoredRanges.R'
'class-Operator.R'
Expand Down
22 changes: 11 additions & 11 deletions R/dplyr-groups.R
Expand Up @@ -158,8 +158,8 @@ group_vars.Ranges <- function(x) character(0)
#' @method group_keys GroupedGenomicRanges
#' @export
#' @importFrom dplyr group_keys
group_keys.GroupedGenomicRanges <- function(.data, ...) {
.data@group_keys
group_keys.GroupedGenomicRanges <- function(.tbl, ...) {
.tbl@group_keys
}

#' @method group_keys GroupedIntegerRanges
Expand All @@ -168,11 +168,11 @@ group_keys.GroupedIntegerRanges <- group_keys.GroupedGenomicRanges

#' @method group_keys Ranges
#' @export
group_keys.Ranges <- function(.data, ...) {
group_keys.Ranges <- function(.tbl, ...) {
if (length(enquos(...)) == 0) {
return(new("DFrame", nrows = 1L))
}
NextMethod(group_by(.data, ...))
NextMethod(group_by(.tbl, ...))
}

#' @method group_indices GroupedGenomicRanges
Expand Down Expand Up @@ -228,20 +228,20 @@ group_data.Ranges <- function(.data) {
#' @method group_split GroupedGenomicRanges
#' @export
#' @importFrom dplyr group_split
group_split.GroupedGenomicRanges <- function(.data, ..., keep = TRUE) {
group_split.GroupedGenomicRanges <- function(.tbl, ..., keep = TRUE) {
if (length(enquos(...)) > 0) {
warning("Ignoring arguments to `...`
and using existing group structure")
}

rng <- .data@delegate
rng <- .tbl@delegate

if (!keep) {
vars_drop <- lapply(group_vars(.data), function(.) rlang::quo(-!!.))
vars_drop <- lapply(group_vars(.tbl), function(.) rlang::quo(-!!.))
rng <- select(rng, !!!vars_drop)
}

unname(S4Vectors::split(rng, .data@group_indices))
unname(S4Vectors::split(rng, .tbl@group_indices))
}

#' @method group_split GroupedIntegerRanges
Expand All @@ -250,9 +250,9 @@ group_split.GroupedIntegerRanges <- group_split.GroupedGenomicRanges

#' @method group_split Ranges
#' @export
group_split.Ranges <- function(.data, ..., keep = TRUE) {
group_split.Ranges <- function(.tbl, ..., keep = TRUE) {
if (length(enquos(...)) == 0) {
return(as(.data, "List"))
return(as(.tbl, "List"))
}
NextMethod(group_by(.data, ...))
NextMethod(group_by(.tbl, ...))
}
40 changes: 28 additions & 12 deletions man/tidyverse-reexports.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bf1f81a

Please sign in to comment.