duplicateRow | R Documentation |
Duplicates rows and columns of a given a data frame.
duplicateRow(x, id.el = 1, times = 1, append = FALSE) duplicateCol(x, id.el = 1, times = 1, append = FALSE)
x |
a data frame. |
id.el |
identity of the elements to be duplicated. |
times |
number of times elements are duplicated. Could be a vector of the same length as |
append |
A logical. If |
returns a data frame with duplicated rows.
duplicateCol()
: returns a data frame with duplicated columns.
data(iris, package = "datasets") iris2 <- duplicateRow(iris, id.el = 1:50, times = 2) iris3 <- duplicateCol( iris, id.el = c("Petal.Length", "Petal.Width"), times = c(1, 2), append = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.