-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
46 lines (29 loc) · 1.47 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: "blocks_plot"
output: github_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
A function to create a Tetris-themed plot using ggplot2's geom_col.
![Example of Tetris plot, showing count of video games with over 5 million sales by manufacturer](outputs/tetrisplotexample.png)
## Data
* <a href = "https://github.com/filmicaesthetic/TetrisChart/blob/main/data/Turns_separated.csv">Turns_separated.csv</a> : template used to place Tetris-themed blocks into the chart
## Use
This plot format is very limited for practical use, and is best used to count occurrences of factors in very small datasets (<100 rows).
Clone and run <a href="https://github.com/filmicaesthetic/TetrisChart/blob/main/scripts/blocks_plot.R">blocks_plot.R</a> and use blocks_plot() to plot data.
``` {r tetris_plot, message = FALSE, eval = FALSE, warning = FALSE}
blocks_plot(data = NULL, count_col = NULL, bgcolor = "#ffffff", blockcolor = "#394d6e")
```
### Arguments
* data : The data to use for the plot
* count_col : The name of column to plot
* bgcolor : colour of plot background
* blockcolor : colour of plot grid lines
Example:
``` {r example, message = FALSE, eval = FALSE, warning = FALSE}
blocks_plot(data = df, count_col = "col_5", bgcolor = "#000000", blockcolor = "grey")
```
<a href = "https://github.com/filmicaesthetic/TetrisChart/blob/main/scripts/Tetris%20Plot%20Example.R">See full example here</a>
## Issues
* Currently has trouble outputting with ggsave