knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(Laurae2)
Functions:
Libraries required :
It is possible to create a data.frame using the RC format. It requires a list as values
or any vector.
# Create default named [5, 5] data.frame data.frame.rc(0, nrow = 5, ncol = 5) # Create named [5, 5] data.frame data.frame.rc(0, nrow = 5, ncol = 5, column_names = c("car", "minicooper", "truck", "porsche", "speedo")) # Create named [5, 5] data.frame with values data.frame.rc(list(1:5, c(TRUE, FALSE, TRUE, FALSE, TRUE), 5:1, c("has", "not", "has", "not", "has"), c(150L, 200L, 250L, 300L, 350L)), nrow = 5, ncol = 5) # Create named [5, 5] data.frame with named values data.frame.rc(list(1:5, c(TRUE, FALSE, TRUE, FALSE, TRUE), 5:1, c("has", "not", "has", "not", "has"), c(150L, 200L, 250L, 300L, 350L)), nrow = 5, ncol = 5, column_names = c("car", "minicooper", "truck", "porsche", "speedo")) # Create named [5, 5] data.frame with values data.frame.rc(list(car = 1:5, minicooper = c(TRUE, FALSE, TRUE, FALSE, TRUE), truck = 5:1, porsche = c("has", "not", "has", "not", "has"), speedo = c(150L, 200L, 250L, 300L, 350L)), nrow = 5, ncol = 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.