-
Notifications
You must be signed in to change notification settings - Fork 15
/
README.Rmd
201 lines (140 loc) · 6.9 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
---
title: "vapoRwave"
author: "Matthew Jordan Oldach"
output:
md_document:
variant: gfm
preserve_yaml: false
---
# VapoRwave Themes
[![License:
MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/moldach/vapoRwave/blob/master/LICENSE.md)
**Contact:**
- [Twitter](https://twitter.com/moldach)
- [GitHub](https://github.com/moldach)
- [Personal Website](https://moldach.github.io/)
## Table of Contents
- [Overview](#overview)
- [Installation](#installation)
- [Windows Font Installation](#windows-font-installation)
- [Themes](#themes)
- [Floral Shoppe](#floral-shoppe)
- [New Retro Wave](#new-retro-wave)
- [jwz](#jwz)
- [Vignettes](#vignettes)
- [Docker](#docker)
- [Contributing](#contributing)
- [License](#license)
## Overview
`vapoRwave` is an R package that provides `ggplot2` themes inspired by the vaporwave movement, a genre of electronic music and art characterized by nostalgic and satirical takes on consumer capitalism, glitch art, anime, 3D-rendered objects, and cyberpunk tropes.
Explore the aesthetics of vaporwave through themes that mimic iconic album covers and visual styles.
## Installation
Use the `devtools` package to install it.
```r
devtools::install_github("moldach/vapoRwave")
# To include the vignette
devtools::install_github("moldach/vapoRwave", build_vignettes=TRUE)
```
Load packages:
```r
library(vapoRwave)
library(ggplot2)
library(extrafont)
```
### Windows Font Installation
While Ubuntu users can effortlessly install fonts, Windows users are required to take an additional step to utilize the fonts provided.
The fonts from the vapoRwave package will be locally installed in `C:\Windows\Users\<username>\MyFonts\`. To use them, move/copy the fonts to **Control Panel -> Appearance and Personalization -> Fonts**.
![](vignettes/figure-gfm/load-windows-fonts-00.png)
![](vignettes/figure-gfm/load-windows-fonts-01.png)
**After each new R session, execute the following commands to make the fonts available:**
```r
library(extrafont)
# Import the TrueType fonts
font_import(paths = "C:/Windows/Fonts/", recursive = TRUE)
```
Select `Y` to continue:
![](vignettes/figure-gfm/load-windows-fonts-02.png)
## Themes
### Floral Shoppe
![](vignettes/figure-gfm/FloralShoppe.png)
```r
ggplot(mpg, aes(displ)) +
geom_histogram(aes(fill=class),
binwidth = .1,
col="black",
size=.1) + # change binwidth
labs(title="Floral Shoppe",
subtitle="Engine Displacement across Vehicle Classes") + floral_shoppe() + scale_fill_floralShoppe()
```
![](vignettes/figure-gfm/floralShoppe_01-1.png)
### New Retro Wave
![](vignettes/figure-gfm/new_retro.jpg)
```r
options(scipen=999) # turn-off scientific notation like 1e+48
data("midwest", package = "ggplot2")
ggplot(midwest, aes(x=area, y=poptotal)) +
geom_point(aes(col=state, size=popdensity)) +
geom_smooth(method="loess", se=F, color = "#FA5F70FF") +
xlim(c(0, 0.1)) +
ylim(c(0, 500000)) +
labs(subtitle="Area Vs Population",
y="Population",
x="Area",
title="New Retro Theme",
caption = "Source: midwest") +
new_retro() +
scale_colour_newRetro() +
guides(size = guide_legend(override.aes = list(colour = "#FA5F70FF")))
```
![](vignettes/figure-gfm/newRetro_01-1.png)
### JWZ
![](vignettes/figure-gfm/jwz.jpg)
```r
ggplot(mpg, aes(class, cty)) +
geom_boxplot(aes(fill=factor(cyl))) +
theme(axis.text.x = element_text(angle=65, vjust=0.6)) +
labs(title="Box plot",
subtitle="City Mileage grouped by Class of vehicle",
caption="Source: mpg",
x="Class of Vehicle",
y="City Mileage") +
jwz() +
scale_fill_jwz()
```
![](vignettes/figure-gfm/jwz_01-1.png)
## Vignettes
For more advanced and complex use-cases, as well as detailed examples and customization options, refer to the [vapoRwave vignette](doc/vapoRwave.html). The vignette explore diverse demos that include information on various palletes, fonts, changing parameters, and integrating with extensions. For a comprehensive guide, consult the vignette for the full potential of the `vapoRwave` package.
When users install the package and want to access the vignettes, they can use the following command to open them:
```r
library(vapoRwave)
browseVignettes("vapoRwave")
```
### Docker
Dive into the world of vapoRwave v0.2.0 and experience the perfect blend of retro aesthetics and modern data visualization within the [Synthwave85](https://github.com/jnolis/synthwave85) RStudio IDE, now more accessible than ever!
The v0.2.0 release streamlines the installation process across various operating systems. Get the New Retro theme in your IDE coupled with a pre-configured Python environment via the reticulate package. Python aficionados can now indulge in retro-flavored coding while leveraging R's simple syntax and powerful graphics.
[![Python and R in a Retro IDE](https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2Fjtug43o_3Sw)](https://youtu.be/jtug43o_3Sw)
For your convenience, we offer two ways to get vapoRwave running in a Docker container:
#### Pull the Pre-Built Docker Image
The easiest way to get started is to pull the pre-built image from Docker Hub, which was optimized for size and security using [Slim](https://github.com/slimtoolkit/slim):
```bash
docker pull moldach686/vaporwave:latest
docker run -p 8787:8787 -e PASSWORD=vaporwave moldach686/vaporwave
```
#### Build from the Dockerfile
Alternatively, if you prefer to build the Docker image yourself from the Dockerfile:
```bash
docker build -t vaporwave .
docker run -p 8787:8787 -e PASSWORD=vaporwave vaporwave
```
Either of these options will start vapoRwave and you can access the IDE by navigating to `http://localhost:8787`` in your web browser. Log in with the username `rstudio` and the password `vaporwave`.
![](vignettes/figure-gfm/docker-and-r-demo.gif)
For instance, you can leverage Pandas for data wrangling and then visualize your results with R's ggplot2, all within this unique environment.
Once inside the IDE, feel free to install additional R packages through the _console_. Alternatively, in the _terminal_ you can install Python packages using `pip3` within a Poetry virtual environment, and any system dependencies using `apt-get`.
![](vignettes/figure-gfm/installs-clip.gif)
Please note that when building from the Dockerfile, you may pull the latest dependencies, which provides the most up-to-date environment, while using the pre-built image ensures a consistent, tested setup.
Enjoy the blend of the past and present in data science with vapoRwave v0.2.0 **Retro Player One**!🕹️📼🎵
## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code
of conduct, and the process for submitting pull requests to us.
## License
This code is released under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.