filter | R Documentation |
These filter_*()
functions are used to subset a data frame. Each function
subsets rows based on the value of one column. For numeric columns, a row
will be kept if the value is greater than or equal to the value specified.
For categorical columns, a row will be kept if the value is equal to the
value specified. Note that when a condition evaluates to NA the row will be
dropped, unlike base subsetting with [
.
filter_aa_change(.data, .value, .preserve = FALSE)
filter_alt_umi_count(.data, .value, .preserve = FALSE)
filter_coverage(.data, .value, .preserve = FALSE)
filter_gene(.data, .value, .preserve = FALSE)
filter_mutation_name(.data, .value, .preserve = FALSE)
filter_ref_umi_count(.data, .value, .preserve = FALSE)
filter_targeted(.data, .value, .preserve = FALSE)
.data |
A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr). |
.value |
Filtering value. If a number, data greater than or equal to the value will be kept. If a string, data equal to the value will be kept. |
.preserve |
Relevant when the |
An object of the same type as .data
. The output has the following
properties:
Rows are a subset of the input, but appear in the same order.
Columns are not modified.
The number of groups may be reduced (if .preserve
is not TRUE
).
Data frame attributes are preserved.
dplyr::filter()
for more complex filtering operations.
data <- tibble::tribble(
~sample, ~gene, ~coverage,
"S1", "atp6", 10,
"S2", "crt", 20,
)
filter_gene(data, "atp6")
filter_coverage(data, 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.