forked from rpruim/statisticalModeling
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathREADME.Rmd
80 lines (61 loc) · 2.19 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "README-"
)
```
# ggformula
<!-- badges: start -->
[![R build status](https://github.com/ProjectMOSAIC/ggformula/workflows/R-CMD-check/badge.svg)](https://github.com/ProjectMOSAIC/ggformula/actions)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/ggformula)](https://cran.r-project.org/package=ggformula)
<!-- badges: end -->
<!--
[![Codecov test coverage](https://codecov.io/gh/ProjectMOSAIC/ggformula/branch/master/graph/badge.svg)](https://codecov.io/gh/ProjectMOSAIC/ggformula?branch=master)
-->
## Formula interface to ggplot2
`ggformula` introduces a family of graphics functions, `gf_point()`,
`gf_density()`, and so on, bring 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`.
## Installation
You can install ggformula from CRAN sith
```{r gh-cran-installation, 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}
suppressPackageStartupMessages(library(ggformula))
data(penguins, package = "palmerpenguins")
penguins |>
set_variable_labels(
bill_length_mm = "bill length (mm)",
bill_depth_mm = "bill depth (mm)"
) |>
gf_jitter(bill_length_mm ~ bill_depth_mm | island ~ sex, color = ~ species,
width = 0.05, height = 0.05, size = 0.5, alpha = 0.6) |>
gf_density2d(alpha = 0.3) |>
gf_labs(title = "Palmer Penguins",
caption = "Data available in palmerpenguins package"
) |>
gf_refine(scale_color_brewer(type = "qual")) |>
gf_theme(theme_bw()) |>
gf_theme(
legend.position = 'top',
text = element_text(colour = "navy", face = "italic")
)
```
### More Information
Find out more about `ggformula` at
<https://www.mosaic-web.org/ggformula/>.