data_unite | R Documentation |
Merge values of multiple variables per observation into one new variable.
data_unite(
data,
new_column = NULL,
select = NULL,
exclude = NULL,
separator = "_",
append = FALSE,
remove_na = FALSE,
ignore_case = FALSE,
verbose = TRUE,
regex = FALSE,
...
)
data |
A data frame. |
new_column |
The name of the new column, as a string. |
select |
Variables that will be included when performing the required tasks. Can be either
If |
exclude |
See |
separator |
A character to use between values. |
append |
Logical, if |
remove_na |
Logical, if |
ignore_case |
Logical, if |
verbose |
Toggle warnings. |
regex |
Logical, if |
... |
Currently not used. |
data
, with a newly created variable.
data_separate()
d <- data.frame(
x = 1:3,
y = letters[1:3],
z = 6:8
)
d
data_unite(d, new_column = "xyz")
data_unite(d, new_column = "xyz", remove = FALSE)
data_unite(d, new_column = "xyz", select = c("x", "z"))
data_unite(d, new_column = "xyz", select = c("x", "z"), append = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.