You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/an-introduction.Rmd
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -460,6 +460,32 @@ up on interesting hits from a combined RNA-seq and ATAC-seq analysis.
460
460
- The [journal article](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-018-1597-8) ([preprint here](https://www.biorxiv.org/content/early/2018/05/23/327841)) has
461
461
details about the overall philosophy and design of plyranges.
462
462
463
+
# Namespace considerations
464
+
465
+
`plyranges` re-exports three functions that otherwise exist in `dplyr` with
466
+
different meanings:
467
+
468
+
-`between(x, y)` wraps `IRanges::pgap()` and returns the gap ranges between
469
+
two paired Ranges objects. This is entirely distinct from `dplyr::between(x,
470
+
left, right)`, which tests whether numeric values fall within a scalar
471
+
interval.
472
+
-`n()` is re-implemented to return group sizes for grouped Ranges objects
473
+
(including grouped lists of ranges). `dplyr::n()` does the same for
474
+
data frames.
475
+
-`n_distinct()` is re-implemented to handle Bioconductor `List` objects via
476
+
`lengths(unique(x))`. `dplyr::n_distinct()` operates on ordinary vectors.
477
+
478
+
Because `plyranges` is typically loaded after `dplyr`, these three names will
479
+
resolve to the `plyranges` versions in your session. If you need the original
480
+
`dplyr` behaviour, call it explicitly: `dplyr::n()`, `dplyr::n_distinct()`,
481
+
or `dplyr::between()`.
482
+
483
+
Note that for the standard `dplyr` verbs — `mutate()`, `filter()`,
484
+
`summarise()`, `select()`, `arrange()`, and `group_by()` — `plyranges`
485
+
registers S4 methods so that these verbs work directly on `GRanges` and
486
+
`IRanges` objects without any renaming. Therefore `mutate(<GRanges>)` works
0 commit comments