query_list | R Documentation |
Find observations matching a query that concerns one or more data frames
within a list of data frames, and return tidy, stackable output. Like
query
but enables query expressions that reference variables in multiple
data frames.
If the query expression references variables from data frames (i.e. list
elements) other than the focal element, the relevant variable(s) will be
joined to the focal element before the query expression is evaluated, see
arguments join_type
and join_by
below.
query_list(
x,
cond,
element,
cols_base,
join_type = "left",
join_by,
pivot_long = TRUE,
pivot_var = "variable",
pivot_val = "value",
as_chr = TRUE
)
x |
A list of data frames |
cond |
Expression to evaluate with respect to one or more variables in
one or more of the data frames within |
element |
Name or integer index of the focal list element of |
cols_base |
(Optional) Tidy-selection of other columns within |
join_type |
If |
join_by |
A character vector of variables to join by. If the join key
columns have different names in |
pivot_long |
Logical indicating whether to pivot the variables
referenced within |
pivot_var |
Prefix for pivoted variable column(s). Defaults to
"variable". Only used if |
pivot_val |
Prefix for pivoted value column(s). Defaults to "value".
Only used if |
as_chr |
Logical indicating whether to coerce the columns referenced in
the query expression |
A data frame reflecting the rows of x[[element]]
that match the given
query. Returned columns include:
(optional) columns matched by argument cols_base
columns referenced within the query expression (pivoted to long form by default)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.