arrange | R Documentation |
arrange()
orders the rows of a data frame by the values of selected
columns.
Unlike other dplyr verbs, arrange()
largely ignores grouping; you
need to explicitly mention grouping variables (or use .by_group = TRUE
)
in order to group by them, and functions of variables are evaluated
once per data frame, not once per group.
## S3 method for class 'Seurat'
arrange(.data, ..., .by_group = FALSE)
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). See Methods, below, for more details. |
... |
< |
.by_group |
If |
Unlike base sorting with sort()
, NA
are:
always sorted to the end for local data, even when wrapped with desc()
.
treated differently for remote data, depending on the backend.
An object of the same type as .data
. The output has the following
properties:
All rows appear in the output, but (usually) in a different place.
Columns are not modified.
Groups are not modified.
Data frame attributes are preserved.
This function is a generic, which means that packages can provide implementations (methods) for other classes. See the documentation of individual methods for extra arguments and differences in behaviour.
The following methods are currently available in loaded packages: \Sexpr[stage=render,results=rd]{dplyr:::methods_rd("arrange")}.
Other single table verbs:
mutate()
,
rename()
,
slice()
,
summarise()
data(pbmc_small)
pbmc_small |>
arrange(nFeature_RNA)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.