pivot_longer.ir | R Documentation |
ir
object from wide to longPivot an ir
object from wide to long
pivot_longer.ir( data, cols, names_to = "name", names_prefix = NULL, names_sep = NULL, names_pattern = NULL, names_ptypes = list(), names_transform = list(), names_repair = "check_unique", values_to = "value", values_drop_na = FALSE, values_ptypes = list(), values_transform = list(), ... )
data |
An object of class |
cols |
< |
names_to |
A character vector specifying the new column or columns to
create from the information stored in the column names of
|
names_prefix |
A regular expression used to remove matching text from the start of each variable name. |
names_sep, names_pattern |
If
If these arguments do not give you enough control, use
|
names_ptypes, values_ptypes |
Optionally, a list of column name-prototype
pairs. Alternatively, a single empty prototype can be supplied, which will
be applied to all columns. A prototype (or ptype for short) is a
zero-length vector (like For backwards compatibility reasons, supplying |
names_transform, values_transform |
Optionally, a list of column
name-function pairs. Alternatively, a single function can be supplied,
which will be applied to all columns. Use these arguments if you need to
change the types of specific columns. For example, If not specified, the type of the columns generated from |
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 |
... |
Additional arguments passed on to methods. |
data
in a long format. If the spectra
column is dropped
or invalidated (see ir_new_ir()
), the ir
class is dropped, else the
object is of class ir
.
tidyr::pivot_longer()
Other tidyverse:
arrange.ir()
,
distinct.ir()
,
extract.ir()
,
filter-joins
,
filter.ir()
,
group_by
,
mutate-joins
,
mutate
,
nest
,
pivot_wider.ir()
,
rename
,
rowwise.ir()
,
select.ir()
,
separate.ir()
,
separate_rows.ir()
,
slice
,
summarize
,
unite.ir()
## pivot_longer ir_sample_data %>% tidyr::pivot_longer( cols = dplyr::any_of(c("holocellulose", "klason_lignin")) )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.