unnest {tidySummarizedExperiment} | R Documentation |
Given a regular expression with capturing groups, extract()
turns
each group into a new column. If the groups don't match, or the input
is NA, the output will be NA.
pivot_longer()
"lengthens" data, increasing the number of rows and
decreasing the number of columns. The inverse transformation is
pivot_wider()
Learn more in vignette("pivot")
.
pivot_wider()
"widens" data, increasing the number of columns and
decreasing the number of rows. The inverse transformation is
pivot_longer()
.
Learn more in vignette("pivot")
.
Convenience function to paste together multiple columns into one.
Given either a regular expression or a vector of character positions,
separate()
turns a single character column into multiple columns.
keep_empty |
See tidyr::unnest |
ptype |
See tidyr::unnest |
.drop |
See tidyr::unnest |
.id |
tidyr::unnest |
.sep |
tidyr::unnest |
.preserve |
See tidyr::unnest |
.data |
A tbl. (See tidyr) |
.names_sep |
See ?tidyr::nest |
into |
Names of new variables to create as character vector.
Use |
regex |
a regular expression used to extract the desired values.
There should be one group (defined by |
convert |
If NB: this will cause string |
cols |
< |
names_to |
A string specifying the name of the column to create
from the data stored in the column names of Can be a character vector, creating multiple columns, if
|
names_sep, names_pattern |
If
If these arguments do not give you enough control, use
|
names_repair |
What happens if the output has invalid column names?
The default, |
values_to |
A string specifying the name of the column to create
from the data stored in cell values. If |
values_drop_na |
If |
names_transform, values_transform |
A list of column name-function pairs.
Use these arguments if you need to change the type of specific columns.
For example, |
names_ptypes, values_ptypes |
A list of column name-prototype pairs.
A prototype (or ptype for short) is a zero-length vector (like If not specified, the type of the columns generated from |
id_cols |
< |
names_from, values_from |
< If |
names_sep |
If |
names_prefix |
String added to the start of every variable name. This is
particularly useful if |
names_glue |
Instead of |
names_sort |
Should the column names be sorted? If |
values_fill |
Optionally, a (scalar) value that specifies what each
This can be a named list if you want to apply different aggregations to different value columns. |
values_fn |
Optionally, a function applied to the This can be a named list if you want to apply different aggregations to different value columns. |
data |
A data frame. |
col |
The name of the new column, as a string or symbol. This argument is passed by expression and supports
quasiquotation (you can unquote strings
and symbols). The name is captured from the expression with
|
... |
< |
na.rm |
If |
remove |
If |
sep |
Separator between columns. If character, If numeric, |
extra |
If
|
fill |
If
|
pivot_longer()
is an updated approach to gather()
, designed to be both
simpler to use and to handle more use cases. We recommend you use
pivot_longer()
for new code; gather()
isn't going away but is no longer
under active development.
pivot_wider()
is an updated approach to spread()
, designed to be both
simpler to use and to handle more use cases. We recommend you use
pivot_wider()
for new code; spread()
isn't going away but is no longer
under active development.
A tidySummarizedExperiment objector a tibble depending on input
A tidySummarizedExperiment objector a tibble depending on input
A tidySummarizedExperiment objector a tibble depending on input
A tidySummarizedExperiment objector a tibble depending on input
A tidySummarizedExperiment objector a tibble depending on input
A tidySummarizedExperiment objector a tibble depending on input
separate()
to split up by a separator.
pivot_wider_spec()
to pivot "by hand" with a data frame that
defines a pivotting specification.
separate()
, the complement.
unite()
, the complement, extract()
which uses regular
expression capturing groups.
tidySummarizedExperiment::pasilla %>% nest(data=-condition) %>% unnest(data) tidySummarizedExperiment::pasilla %>% nest(data=-condition) tidySummarizedExperiment::pasilla %>% extract(type, into="sequencing", regex="([a-z]*)_end", convert=TRUE) # See vignette("pivot") for examples and explanation library(dplyr) tidySummarizedExperiment::pasilla %>% pivot_longer(c(condition, type), names_to="name", values_to="value") # See vignette("pivot") for examples and explanation library(dplyr) tidySummarizedExperiment::pasilla %>% pivot_wider(names_from=feature, values_from=counts) tidySummarizedExperiment::pasilla %>% unite("group", c(condition, type))