knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of rportr is to streamline the building of parameterized reports, including setup, table generation, and handling complex project directories.
You can install the development version from GitHub with:
# install.packages("devtools") devtools::install_github("beaulucas/rportr")
This is a basic example which shows you how to solve a common problem:
Say you have a ./data
directory in your project, full of a mix of text files and RDS files. How to read all of them at once and assign them descriptive names?
Let's create a directory to demonstrate it. youtube
dir.create("./data") write.csv(mtcars, "./data/mtcars.csv") saveRDS(iris, "./data/iris.rds", compress = FALSE)
The directory above takes the following structure:
-- data ---- mtcars.csv ---- iris.rds
Now we will use read_directory
to read in the file and assign variable names based on the file name.
library(rportr) read_directory("./data")
unlink("./data", recursive = TRUE)
kable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.