Update README.Rmd
This commit is contained in:
parent
7c21338ec9
commit
91d826bed1
1 changed files with 102 additions and 59 deletions
161
README.Rmd
161
README.Rmd
|
|
@ -1,59 +1,102 @@
|
||||||
---
|
---
|
||||||
output: github_document
|
output: github_document
|
||||||
---
|
---
|
||||||
|
|
||||||
<!-- README.md is generated from README.Rmd. Please edit that file -->
|
<!-- README.md is generated from README.Rmd. Please edit that file -->
|
||||||
|
|
||||||
```{r, include = FALSE}
|
```{r, include = FALSE}
|
||||||
knitr::opts_chunk$set(
|
knitr::opts_chunk$set(
|
||||||
collapse = TRUE,
|
collapse = TRUE,
|
||||||
comment = "#>",
|
comment = "#>",
|
||||||
fig.path = "man/figures/README-",
|
fig.path = "man/figures/README-",
|
||||||
out.width = "100%"
|
out.width = "100%"
|
||||||
)
|
)
|
||||||
|
|
||||||
desc = read.dcf('DESCRIPTION')
|
desc = read.dcf('DESCRIPTION')
|
||||||
desc = setNames(as.list(desc), colnames(desc))
|
desc = setNames(as.list(desc), colnames(desc))
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
# `r desc$Package` <img src="man/figures/logo.png" align="right" alt="" width="120"/>
|
# `r desc$Package` <img src="man/figures/logo.png" align="right" alt="" width="120"/>
|
||||||
|
|
||||||
> `r desc$Title`
|
> `r desc$Title`
|
||||||
|
|
||||||
`visualizeR` proposes some utils to get REACH and AGORA colors, ready-to-go color palettes, and a few visualization functions (horizontal hist graph for instance).
|
`visualizeR` proposes some utils to get REACH and AGORA colors, ready-to-go color palettes, and a few visualization functions (horizontal hist graph for instance).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
You can install the last version of visualizeR from
|
You can install the last version of visualizeR from
|
||||||
[GitHub](https://github.com/) with:
|
[GitHub](https://github.com/) with:
|
||||||
|
|
||||||
```{r, eval = FALSE}
|
```{r, eval = FALSE}
|
||||||
# install.packages("devtools")
|
# install.packages("devtools")
|
||||||
devtools::install_github("gnoblet/visualizeR", build_vignettes = TRUE)
|
devtools::install_github("gnoblet/visualizeR", build_vignettes = TRUE)
|
||||||
```
|
```
|
||||||
|
|
||||||
## Roadmap
|
## Roadmap
|
||||||
|
|
||||||
Roadmap is as follows:
|
Roadmap is as follows:
|
||||||
|
|
||||||
- [X] Add IMPACT's colors
|
- [X] Add IMPACT's colors
|
||||||
- [X] Add all color palettes from the internal documentation
|
- [X] Add all color palettes from the internal documentation
|
||||||
- [ ] There remains to be added more-than-7-color palettes and black color palettes
|
- [ ] There remains to be added more-than-7-color palettes and black color palettes
|
||||||
- [ ] Add new types of visualization (e.g. dumbbell plot)
|
- [ ] Add new types of visualization (e.g. dumbbell plot)
|
||||||
- [ ] Use examples
|
- [ ] Use examples
|
||||||
- [ ] Add some ease-map functions
|
- [ ] Add some ease-map functions
|
||||||
- [ ] Add some interactive functions (maps and graphs)
|
- [ ] Add some interactive functions (maps and graphs)
|
||||||
|
|
||||||
## Request
|
## Request
|
||||||
|
|
||||||
Please, do not hesitate to pull request any new viz or colors or color palettes, or to email request any change (guillaume.noblet@reach-initiative.org or gnoblet@zaclys.net).
|
Please, do not hesitate to pull request any new viz or colors or color palettes, or to email request any change (guillaume.noblet@reach-initiative.org or gnoblet@zaclys.net).
|
||||||
|
|
||||||
|
|
||||||
## Example
|
## Example 1: extracting colors
|
||||||
|
|
||||||
```{r example, eval = FALSE}
|
Color palettes for REACH, AGORA and IMPACT are available. Functions to access colors and palettes are `cols_initiative()` or `pal_initiative()`. For now, the initiative with the most colors and color palettes is REACH. Feel free to pull requests new AGORA and IMPACT colors.
|
||||||
library(visualizeR)
|
|
||||||
# Get all saved REACH colors, named
|
```{r example-colors, eval = FALSE}
|
||||||
cols_reach(unnamed = F)
|
library(visualizeR)
|
||||||
```
|
|
||||||
|
# Get all saved REACH colors, named
|
||||||
|
cols_reach(unnamed = F)[1:10]
|
||||||
|
|
||||||
|
# Extract a color palette as hexadecimal codes and reversed
|
||||||
|
pal_reach(palette = "main", reversed = TRUE, color_ramp_palette = FALSE)
|
||||||
|
|
||||||
|
# Get all color palettes names
|
||||||
|
pal_reach(show_palettes = T)
|
||||||
|
```
|
||||||
|
## Example 2: Bar chart, already REACH themed
|
||||||
|
|
||||||
|
```{r example-bar-chart, eval = TRUE}
|
||||||
|
library(visualizeR)
|
||||||
|
library(palmerpenguins)
|
||||||
|
library(dplyr)
|
||||||
|
|
||||||
|
df <- penguins |>
|
||||||
|
group_by(island, species) |>
|
||||||
|
summarize(
|
||||||
|
mean_bl = mean(bill_length_mm, na.rm = T),
|
||||||
|
mean_fl = mean(flipper_length_mm, na.rm = T)) |>
|
||||||
|
ungroup()
|
||||||
|
|
||||||
|
# Simple bar chart by group
|
||||||
|
bar_reach(df, mean_bl, island, species, percent = FALSE, x_title = "Mean of bill length")
|
||||||
|
|
||||||
|
# Using another color palette
|
||||||
|
bar_reach(df, mean_bl, island, species, percent = FALSE, palette = "artichoke_3", legend_rev = TRUE)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Example 3: Point chart, already REACH themed
|
||||||
|
```{r example-point-chart, eval = TRUE}
|
||||||
|
|
||||||
|
# Simple point chart
|
||||||
|
point_reach(penguins, bill_length_mm, flipper_length_mm)
|
||||||
|
|
||||||
|
# Point chart with grouping colors, greater dot size, some transparency, reversed color palette
|
||||||
|
point_reach(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.5, size = 2, reverse = TRUE)
|
||||||
|
|
||||||
|
# Using another color palettes
|
||||||
|
point_reach(penguins, bill_length_mm, flipper_length_mm, island, palette = "artichoke_3")
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue