15
15
# ' @details
16
16
# ' ## Locales
17
17
# ' The sort order for character vectors will depend on the collating sequence
18
- # ' of the locale in use: see [ locales()] .
18
+ # ' of the locale in use: see locales().
19
19
# '
20
20
# ' ## Missing values
21
21
# ' Unlike base sorting with `sort()`, `NA` are:
29
29
# ' * Columns are not modified.
30
30
# ' * Groups are not modified.
31
31
# ' * Data frame attributes are preserved.
32
- # ' @section Methods:
33
- # ' This function is a **generic**, which means that packages can provide
34
- # ' implementations (methods) for other classes. See the documentation of
35
- # ' individual methods for extra arguments and differences in behaviour.
36
- # '
37
- # ' The following methods are currently available in loaded packages:
38
32
# '
39
33
# ' @rdname dplyr-methods
40
34
# ' @name arrange
44
38
# ' lazy data frame (e.g. from dbplyr or dtplyr). See *Methods*, below, for
45
39
# ' more details.
46
40
# ' @param ... <[`tidy-eval`][dplyr_eval]> Variables, or functions or
47
- # ' variables. Use [ desc()] to sort a variable in descending order.
41
+ # ' variables. Use desc() to sort a variable in descending order.
48
42
# ' @param .by_group If TRUE, will sort first by grouping variable. Applies to grouped data frames only.
49
43
# '
50
44
# ' @family single table verbs
@@ -91,7 +85,7 @@ arrange.Seurat <- function(.data, ..., .by_group = FALSE) {
91
85
# '
92
86
# ' When column-binding, rows are matched by position, so all data
93
87
# ' frames must have the same number of rows. To match by value, not
94
- # ' position, see [ mutate-joins] .
88
+ # ' position, see mutate-joins.
95
89
# ' @param .id Data frame identifier.
96
90
# '
97
91
# ' When `.id` is supplied, a new column of identifiers is
@@ -231,29 +225,11 @@ distinct.Seurat <- function (.data, ..., .keep_all = FALSE)
231
225
# '
232
226
# ' dplyr is not yet smart enough to optimise filtering optimisation
233
227
# ' on grouped datasets that don't need grouped calculations. For this reason,
234
- # ' filtering is often considerably faster on [ ungroup()] ed data.
228
+ # ' filtering is often considerably faster on ungroup()ed data.
235
229
# '
236
230
# ' @importFrom dplyr filter
237
231
# '
238
- # ' @section Useful filter functions:
239
232
# '
240
- # ' * [`==`], [`>`], [`>=`] etc
241
- # ' * [`&`], [`|`], [`!`], [xor()]
242
- # ' * [is.na()]
243
- # ' * [between()], [near()]
244
- # '
245
- # ' @section Grouped tibbles:
246
- # '
247
- # ' Because filtering expressions are computed within groups, they may
248
- # ' yield different results on grouped tibbles. This will be the case
249
- # ' as soon as an aggregating, lagging, or ranking function is
250
- # ' involved. Compare this ungrouped filtering:
251
- # '
252
- # '
253
- # ' The former keeps rows with `mass` greater than the global average
254
- # ' whereas the latter keeps rows with `mass` greater than the gender
255
- # '
256
- # ' average.
257
233
# ' @family single table verbs
258
234
# ' @inheritParams arrange
259
235
# ' @param ... <[`tidy-eval`][dplyr_eval]> Logical predicates defined in
@@ -274,8 +250,6 @@ distinct.Seurat <- function (.data, ..., .keep_all = FALSE)
274
250
# ' implementations (methods) for other classes. See the documentation of
275
251
# ' individual methods for extra arguments and differences in behaviour.
276
252
# '
277
- # ' The following methods are currently available in loaded packages:
278
- # ' @seealso [filter_all()], [filter_if()] and [filter_at()].
279
253
# '
280
254
# ' @rdname dplyr-methods
281
255
# ' @name filter
@@ -326,9 +300,9 @@ filter.Seurat <- function (.data, ..., .preserve = FALSE)
326
300
# ' This argument was previously called `add`, but that prevented
327
301
# ' creating a new grouping variable called `add`, and conflicts with
328
302
# ' our naming conventions.
329
- # ' @param .drop When `.drop = TRUE`, empty groups are dropped. See [ group_by_drop_default()] for
303
+ # ' @param .drop When `.drop = TRUE`, empty groups are dropped. See group_by_drop_default() for
330
304
# ' what the default value is for this argument.
331
- # ' @return A [ grouped data frame][grouped_df()] , unless the combination of `...` and `add`
305
+ # ' @return A grouped data frame, unless the combination of `...` and `add`
332
306
# ' yields a non empty set of grouping columns, a regular (ungrouped) data frame
333
307
# ' otherwise.
334
308
# ' @section Methods:
@@ -373,27 +347,7 @@ group_by.Seurat <- function (.data, ..., .add = FALSE, .drop = group_by_drop_def
373
347
# '
374
348
# ' @importFrom dplyr summarise
375
349
# '
376
- # ' @section Useful functions:
377
350
# '
378
- # ' * Center: [mean()], [median()]
379
- # ' * Spread: [sd()], [IQR()], [mad()]
380
- # ' * Range: [min()], [max()], [quantile()]
381
- # ' * Position: [first()], [last()], [nth()],
382
- # ' * Count: [n()], [n_distinct()]
383
- # ' * Logical: [any()], [all()]
384
- # '
385
- # ' @section Backend variations:
386
- # '
387
- # ' The data frame backend supports creating a variable and using it in the
388
- # ' same summary. This means that previously created summary variables can be
389
- # ' further transformed or combined within the summary, as in [mutate()].
390
- # ' However, it also means that summary variables with the same names as previous
391
- # ' variables overwrite them, making those variables unavailable to later summary
392
- # ' variables.
393
- # '
394
- # ' This behaviour may not be supported in other backends. To avoid unexpected
395
- # ' results, consider using new names for your summary variables, especially when
396
- # ' creating multiple summaries.
397
351
# '
398
352
# ' @export
399
353
# ' @inheritParams arrange
@@ -405,30 +359,15 @@ group_by.Seurat <- function (.data, ..., .add = FALSE, .drop = group_by_drop_def
405
359
# ' * A vector of length 1, e.g. `min(x)`, `n()`, or `sum(is.na(y))`.
406
360
# ' * A vector of length `n`, e.g. `quantile()`.
407
361
# ' * A data frame, to add multiple columns from a single expression.
362
+ # '
408
363
# ' @family single table verbs
409
- # ' @return
410
- # ' An object _usually_ of the same type as `.data`.
411
- # '
412
- # ' * The rows come from the underlying `group_keys()`.
413
- # ' * The columns are a combination of the grouping keys and the summary
414
- # ' expressions that you provide.
415
- # ' * If `x` is grouped by more than one variable, the output will be another
416
- # ' [grouped_df] with the right-most group removed.
417
- # ' * If `x` is grouped by one variable, or is not grouped, the output will
418
- # ' be a [tibble].
419
- # ' * Data frame attributes are **not** preserved, because `summarise()`
420
- # ' fundamentally creates a new data frame.
421
- # ' @section Methods:
422
- # ' This function is a **generic**, which means that packages can provide
423
- # ' implementations (methods) for other classes. See the documentation of
424
- # ' individual methods for extra arguments and differences in behaviour.
425
- # '
426
- # ' The following methods are currently available in loaded packages:
364
+ # ' @return A tibble
427
365
# '
428
366
# ' @rdname dplyr-methods
429
367
# ' @name summarise
430
368
# '
431
369
# ' @examples
370
+ # '
432
371
# ' `%>%` = magrittr::`%>%`
433
372
# ' pbmc_small %>% summarise(mean(nCount_RNA))
434
373
# '
@@ -457,20 +396,6 @@ summarise.Seurat <- function (.data, ...)
457
396
# '
458
397
# ' @importFrom dplyr mutate
459
398
# '
460
- # ' @section Useful mutate functions:
461
- # '
462
- # ' * [`+`], [`-`], [log()], etc., for their usual mathematical meanings
463
- # '
464
- # ' * [lead()], [lag()]
465
- # '
466
- # ' * [dense_rank()], [min_rank()], [percent_rank()], [row_number()],
467
- # ' [cume_dist()], [ntile()]
468
- # '
469
- # ' * [cumsum()], [cummean()], [cummin()], [cummax()], [cumany()], [cumall()]
470
- # '
471
- # ' * [na_if()], [coalesce()]
472
- # '
473
- # ' * [if_else()], [recode()], [case_when()]
474
399
# '
475
400
# ' @section Grouped tibbles:
476
401
# '
@@ -561,10 +486,6 @@ mutate.Seurat <- function(.data, ...)
561
486
# '
562
487
# ' Rename individual variables using `new_name = old_name` syntax.
563
488
# '
564
- # ' @section Scoped selection and renaming:
565
- # '
566
- # ' Use the three scoped variants ([rename_all()], [rename_if()], [rename_at()])
567
- # ' to renaming a set of variables with a function.
568
489
# '
569
490
# ' @importFrom dplyr rename
570
491
# '
@@ -615,18 +536,10 @@ rename.Seurat <- function(.data, ...)
615
536
# ' Group input by rows
616
537
# '
617
538
# '
618
- # ' See [this repository](https://github.com/jennybc/row-oriented-workflows)
619
- # ' for alternative ways to perform row-wise operations.
620
- # '
621
539
# ' `rowwise()` is used for the results of [do()] when you
622
540
# ' create list-variables. It is also useful to support arbitrary
623
541
# ' complex operations that need to be applied to each row.
624
542
# '
625
- # ' Currently, rowwise grouping only works with data frames. Its
626
- # ' main impact is to allow you to work with list-variables in
627
- # ' [summarise()] and [mutate()] without having to
628
- # ' use \code{[[1]]}. This makes `summarise()` on a rowwise tbl
629
- # ' effectively equivalent to [plyr::ldply()].
630
543
# '
631
544
# ' @importFrom dplyr rowwise
632
545
# '
@@ -874,14 +787,6 @@ full_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", ".
874
787
# ' to select, remove, and duplicate rows. It is accompanied by a number of
875
788
# ' helpers for common use cases:
876
789
# '
877
- # ' * `slice_head()` and `slice_tail()` select the first or last rows.
878
- # ' * `slice_sample()` randomly selects rows.
879
- # ' * `slice_min()` and `slice_max()` select rows with highest or lowest values
880
- # ' of a variable.
881
- # '
882
- # ' If `.data` is a [grouped_df], the operation will be performed on each group,
883
- # ' so that (e.g.) `slice_head(df, n = 5)` will select the first five rows in
884
- # ' each group.
885
790
# '
886
791
# ' @importFrom dplyr slice
887
792
# '
@@ -900,12 +805,6 @@ full_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", ".
900
805
# ' The values provided must be either all positive or all negative.
901
806
# ' Indices beyond the number of rows in the input are silently ignored.
902
807
# '
903
- # ' For `slice_helpers()`, these arguments are passed on to methods.
904
- # '
905
- # '
906
- # ' If `n` is greater than the number of rows in the group (or `prop > 1`),
907
- # ' the result will be silently truncated to the group size. If the
908
- # ' `prop`ortion of a group size is not an integer, it is rounded down.
909
808
# ' @return
910
809
# ' An object of the same type as `.data`. The output has the following
911
810
# ' properties:
@@ -914,19 +813,6 @@ full_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", ".
914
813
# ' * Columns are not modified.
915
814
# ' * Groups are not modified.
916
815
# ' * Data frame attributes are preserved.
917
- # ' @section Methods:
918
- # ' These function are **generic**s, which means that packages can provide
919
- # ' implementations (methods) for other classes. See the documentation of
920
- # ' individual methods for extra arguments and differences in behaviour.
921
- # '
922
- # ' Methods available in currently loaded packages:
923
- # '
924
- # ' * `slice()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice")}.
925
- # ' * `slice_head()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice_head")}.
926
- # ' * `slice_tail()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice_tail")}.
927
- # ' * `slice_min()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice_min")}.
928
- # ' * `slice_max()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice_max")}.
929
- # ' * `slice_sample()`: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("slice_sample")}.
930
816
# '
931
817
# ' @rdname dplyr-methods
932
818
# ' @name slice
@@ -960,14 +846,9 @@ slice.Seurat <- function (.data, ..., .preserve = FALSE)
960
846
# ' Select (and optionally rename) variables in a data frame, using a concise
961
847
# ' mini-language that makes it easy to refer to variables based on their name
962
848
# ' (e.g. `a:f` selects all columns from `a` on the left to `f` on the
963
- # ' right). You can also use predicate functions like [ is.numeric] to select
849
+ # ' right). You can also use predicate functions like is.numeric to select
964
850
# ' variables based on their properties.
965
851
# '
966
- # '
967
- # ' ## Overview of selection features
968
- # '
969
- # ' ```{r, child = "man/rmd/overview.Rmd"}
970
- # ' ```
971
852
# '
972
853
# ' @importFrom dplyr select
973
854
# '
@@ -986,13 +867,6 @@ slice.Seurat <- function (.data, ..., .preserve = FALSE)
986
867
# ' * Data frame attributes are preserved.
987
868
# ' * Groups are maintained; you can't select off grouping variables.
988
869
# '
989
- # ' @section Methods:
990
- # ' This function is a **generic**, which means that packages can provide
991
- # ' implementations (methods) for other classes. See the documentation of
992
- # ' individual methods for extra arguments and differences in behaviour.
993
- # '
994
- # ' The following methods are currently available in loaded packages:
995
- # ' \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("select")}.
996
870
# '
997
871
# ' @examples
998
872
# '
@@ -1035,24 +909,7 @@ select.Seurat <- function (.data, ...)
1035
909
# ' Sample n rows from a table
1036
910
# '
1037
911
# ' @description
1038
- # ' \Sexpr[results=rd, stage=render]{lifecycle::badge("superseded")}
1039
- # ' `sample_n()` and `sample_frac()` have been superseded in favour of
1040
- # ' [slice_sample()]. While they will not be deprecated in the near future,
1041
- # ' retirement means that we will only perform critical bug fixes, so we recommend
1042
- # ' moving to the newer alternative.
1043
- # '
1044
- # ' These functions were superseded because we realised it was more convenient to
1045
- # ' have two mutually exclusive arguments to one function, rather than two
1046
- # ' separate functions. This also made it to clean up a few other smaller
1047
- # ' design issues with `sample_n()`/`sample_frac`:
1048
- # '
1049
- # ' * The connection to `slice()` was not obvious.
1050
- # ' * The name of the first argument, `tbl`, is inconsistent with other
1051
- # ' single table verbs which use `.data`.
1052
- # ' * The `size` argument uses tidy evaluation, which is surprising and
1053
- # ' undocumented.
1054
- # ' * It was easier to remove the deprecated `.env` argument.
1055
- # ' * `...` was in a suboptimal position.
912
+ # ' Sample n rows from a table
1056
913
# '
1057
914
# ' @importFrom dplyr sample_n
1058
915
# '
@@ -1250,13 +1107,6 @@ add_count.Seurat <- function(x, ..., wt = NULL, sort = FALSE, name = NULL, .drop
1250
1107
# ' as names for a named vector. Specified in a similar manner as \code{var}.
1251
1108
# ' @param ... For use by methods.
1252
1109
# ' @return A vector the same size as `.data`.
1253
- # ' @section Methods:
1254
- # ' This function is a **generic**, which means that packages can provide
1255
- # ' implementations (methods) for other classes. See the documentation of
1256
- # ' individual methods for extra arguments and differences in behaviour.
1257
- # '
1258
- # ' The following methods are currently available in loaded packages:
1259
- # ' \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("pull")}.
1260
1110
# '
1261
1111
# ' @rdname dplyr-methods
1262
1112
# ' @name pull
0 commit comments