-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathggradar.Rmd
45 lines (29 loc) · 1.35 KB
/
ggradar.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: "ggplot2 extensions: ggradar"
---
### ggradar
<https://github.com/ricardo-bion/ggradar>
ggradar allows you to build radar charts with ggplot2. This package is based on [Paul Williamson's](http://rstudio-pubs-static.s3.amazonaws.com/5795_e6e6411731bb4f1b9cc7eb49499c2082.html) code, with new aesthetics and compatibility with ggplot2 2.0.
It was inspired by [d3radaR](http://www.buildingwidgets.com/blog/2015/12/9/week-49-d3radarr), an htmlwidget built by [timelyportfolio](https://github.com/timelyportfolio).
```{r, message=FALSE,warning=FALSE, fig.width=15, fig.height=10}
# Example from https://github.com/ricardo-bion/ggradar
library(ggplot2)
library(ggradar)
suppressPackageStartupMessages(library(dplyr))
library(scales)
mtcars %>%
add_rownames( var = "group" ) %>%
mutate_each(funs(rescale), -group) %>%
tail(4) %>% select(1:10) -> mtcars_radar
ggradar(mtcars_radar)
```
```{r}
knitr::kable(mtcars_radar,format="markdown")
```
## Custom fonts
This package requires the Airbnb font and the extrafont package.
```{r, eval=FALSE}
# configured to work on a Mac, change directory to Unix or Windows
download.file("https://dl.dropboxusercontent.com/u/2364714/airbnb_ttf_fonts/Circular Air-Light 3.46.45 PM.ttf", "/Library/Fonts/Circular Air-Light 3.46.45 PM.ttf", method="curl")
extrafont::font_import(pattern = 'Circular', prompt=FALSE)
```