This code was found on R-bloggers. It can be found at https://www.r-bloggers.com/a-quick-way-to-do-row-repeat-and-col-repeat-rep-row-rep-col/ and is written by TszKin Julian. I use it frequently enough I am putting it in a package for myself. It repeats rows and columns.
First, you need to install the devtools package. You can do this from CRAN. Invoke R and then type
install.packages("devtools")
Load the devtools package.
library(devtools)
install_github("jholderieath/repColrepRow")
Use is simple. These functions allow easy replication of rows and columns
library(repColrepRow)
repRow(x, n)
repCol(x, n)
Arguments to the functions are:
x, n
where x
is row/column to be repeated and n
number of times to be repeated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.