duplicate | R Documentation |
Duplicate rows in a data frame, modifying a specified column.
duplicate(data, ...)
duplicate_(data, column)
data |
A |
... , column |
A key-value pair of the column to modify. |
A data frame
or quitte
object, same as input.
require(dplyr)
(data <- tibble(region = rep(c('AFR', 'CHN'), 2),
variable = paste('Var', c(1, 1, 2, 2)),
value = 1:4))
data %>% duplicate(region = 'World')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.