InsertRow | R Documentation |
Inserts a new row into a data frame
InsertRow(data, NewRow, RowNum = NULL)
data |
a data frame to insert the new row into. |
NewRow |
a vector whose length is the same as the number of columns in
|
RowNum |
numeric indicating which row to insert the new row as. If not
specified then the new row is added to the end using a vanilla
|
The function largely implements: http://stackoverflow.com/a/11562428
# Create dummy data
A <- B <- C <- D <- sample(1:20, size = 20, replace = TRUE)
Data <- data.frame(A, B, C, D)
# Create new row
New <- rep(1000, 4)
# Insert into 4th row
Data <- InsertRow(Data, NewRow = New, RowNum = 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.