An open API service indexing awesome lists of open source software.

https://github.com/bearloga/compostable

R Markdown document for making a compostable vs not compostable table dynamically from files in directories
https://github.com/bearloga/compostable

Last synced: 8 months ago
JSON representation

R Markdown document for making a compostable vs not compostable table dynamically from files in directories

Awesome Lists containing this project

README

          

---
title: "Compostables"
output: github_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, message = FALSE)
```

The [R Markdown](https://rmarkdown.rstudio.com/) document [compost.Rmd](compost.Rmd) together with [styles.css](styles.css) produces an HTML page like:

![Screenshot of generated web page](output.png)

...which can be saved to a PDF, printed, and laminated:

![Photo of laminated compostables](laminated.jpg)

## Images

The document generated by a page based on files in the `images/compostable` and `images/not compostable` directories which looked like:

```{r directory}
directory <- data.frame(
pathString = fs::dir_ls("images", recurse = TRUE),
stringsAsFactors = FALSE
)
```
```{r tree}
library(data.tree) # install.packages("data.tree")
library(magrittr)

tree <- as.Node(directory)
ToDataFrameTree(tree)$levelName %>%
paste0(collapse = "\n") %>%
cat
```