forked from rpruim/statisticalModeling
-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.Rmd
77 lines (57 loc) · 2.08 KB
/
index.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
---
output: html_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
# fig.path = "README-",
fig.width = 7,
fig.height = 3
)
library(ggformula)
```
# ggformula <img src="docs/logo-150.png" align="right" />
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ggformula)](https://cran.r-project.org/package=ggformula)
## ggplot2 via formulas and pipes
`ggformula` introduces a family of graphics functions, `gf_point()`,
`gf_density()`, and so on, bringing the formula interface to `ggplot()`. This
captures and extends the excellent simplicity of the `lattice`-graphics' formula
interface, while providing the intuitive "add this component" capabilities of
`ggplot2` using `maggrittr` pipes.
## Installation
You can install from CRAN with
```{r, eval = FALSE}
install.packages("ggformula")
```
or from github with:
```{r gh-installation, eval = FALSE}
# install.packages("devtools")
devtools::install_github("ProjectMOSAIC/ggformula")
```
## Using ggformula
The following example illustrates a typical plot constructed with ggformula.
```{r example}
library(ggformula)
data(penguins, package = "palmerpenguins")
penguins |>
gf_jitter(bill_length_mm ~ bill_depth_mm, color = ~ species,
width = 0.05, height = 0.05, alpha = 0.6, seed = 123) |>
gf_density2d(alpha = 0.3) |>
gf_labs(title = "Palmer Penguins",
caption = "Data available in palmerpenguins package",
y = "bill length (mm)",
x = "bill depth (mm)"
) |>
gf_theme(theme_bw()) |>
gf_theme(text = element_text(colour = "navy", face = "italic"))
```
### Tutorials
Interactive tutorials demonstrating the package functionality can be run with
```r
learnr::run_tutorial("introduction", package = "ggformula")
learnr::run_tutorial("refining", package = "ggformula")
```
### Package Vignette
The package vignette is available at [https://cran.r-project.org/package=ggformula/vignettes/ggformula.html](https://cran.r-project.org/package=ggformula/vignettes/ggformula.html).