This is a simple package to solve an issue I run into quite often: convert a simple data structure I am working with (i.e., a vector or data frame) into code that can be copy and pasted into an R script or the R interpreter that will reproduce the original object.
Install from GitHub:
if (!requireNamespace("devtools")) { install.packages("devtools") } devtools::install_github("bgreenwell/cprint")
Output can be copied and pasted directly into an R script or the R interpreter:
library(cprint) cprint(iris[1:5, ]) cprint(iris$Petal.Width[1:5]) cprint(iris$Species[1:5])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.