separate.ir {ir} | R Documentation |
Separate a character column in an ir
object into multiple columns with a regular expression or numeric locations
Description
Separate a character column in an ir
object into multiple columns with a regular expression or numeric locations
Usage
separate.ir(
data,
col,
into,
sep = "[^[:alnum:]]+",
remove = TRUE,
convert = FALSE,
extra = "warn",
fill = "warn",
...
)
Arguments
data |
An object of class |
col |
Column name or position. This is passed to
This argument is passed by expression and supports quasiquotation (you can unquote column names or column positions). |
into |
Names of new variables to create as character vector.
Use |
sep |
Separator between columns. If character, If numeric, |
remove |
If |
convert |
If NB: this will cause string |
extra |
If
|
fill |
If
|
... |
Additional arguments passed on to methods. |
Value
.data
with separated columns. If the spectra
column is
dropped or invalidated (see ir_new_ir()
), the ir
class is dropped, else
the object is of class ir
.
Source
See Also
Other tidyverse:
arrange.ir()
,
distinct.ir()
,
extract.ir()
,
filter-joins
,
filter.ir()
,
group_by
,
mutate-joins
,
mutate
,
nest
,
pivot_longer.ir()
,
pivot_wider.ir()
,
rename
,
rowwise.ir()
,
select.ir()
,
separate_rows.ir()
,
slice
,
summarize
,
unite.ir()
Examples
## separate
ir_sample_data %>%
tidyr::separate(
col = "id_sample", c("a", "b", "c")
)