View source: R/data_replicate.R
data_replicate | R Documentation |
Expand a data frame by replicating rows based on another variable that contains the counts of replications per row.
data_replicate(
data,
expand = NULL,
select = NULL,
exclude = NULL,
remove_na = FALSE,
ignore_case = FALSE,
verbose = TRUE,
regex = FALSE,
...
)
data |
A data frame. |
expand |
The name of the column that contains the counts of replications
for each row. Can also be a numeric value, indicating the position of that
column. Note that the variable indicated by |
select |
Variables that will be included when performing the required tasks. Can be either
If |
exclude |
See |
remove_na |
Logical. If |
ignore_case |
Logical, if |
verbose |
Toggle warnings. |
regex |
Logical, if |
... |
Currently not used. |
A dataframe with each row replicated as many times as defined in expand
.
data(mtcars)
data_replicate(head(mtcars), "carb")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.