-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
58 lines (41 loc) · 3.17 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
---
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.width = 8,
fig.height = 8,
fig.path = "man/figures/README-"
)
```
# anscombiser
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/paulnorthrop/anscombiser?branch=main&svg=true)](https://ci.appveyor.com/project/paulnorthrop/anscombiser)
[![R-CMD-check](https://github.com/paulnorthrop/anscombiser/workflows/R-CMD-check/badge.svg)](https://github.com/paulnorthrop/anscombiser/actions)
[![Coverage Status](https://codecov.io/github/paulnorthrop/anscombiser/coverage.svg?branch=main)](https://codecov.io/github/paulnorthrop/anscombiser?branch=master)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/anscombiser)](https://cran.r-project.org/package=anscombiser)
[![Downloads (monthly)](https://cranlogs.r-pkg.org/badges/anscombiser?color=brightgreen)](https://cran.r-project.org/package=anscombiser)
[![Downloads (total)](https://cranlogs.r-pkg.org/badges/grand-total/anscombiser?color=brightgreen)](https://cran.r-project.org/package=anscombiser)
### What does anscombiser do?
Anscombe's quartet are a set of four two-variable datasets that have several common summary statistics (essentially means, variances and correlation) but which have very different joint distributions. This becomes apparent when the data are plotted, which illustrates the importance of using graphical displays in Statistics. The `anscombiser` package provides a quick and easy way to create several datasets that have common values for Anscombe's summary statistics but display very different behaviour when plotted. It does this by transforming (shifting, scaling and rotating) the dataset to achieve target summary statistics.
### An example
The `mimic()` function transforms an input dataset (`dino` below left) so that it has the same values of Anscombe's summary statistics as another dataset (`trump` below right).
```{r, trump, out.width='50%', fig.show='hold'}
library(anscombiser)
library(datasauRus)
dino <- datasaurus_dozen_wide[, c("dino_x", "dino_y")]
new_dino <- mimic(dino, trump)
plot(new_dino, legend_args = list(x = "topright"))
plot(new_dino, input = TRUE, legend_args = list(x = "bottomright"), pch = 20)
```
In this example these images had similar summary statistics from the outset and therefore the appearance of the `dino` dataset has changed little. Otherwise, the first dataset will be deformed but its general shape will still be recognisable.
The rotation applied to the input dataset is not unique. The function `mimic` (and a function `anscombise` that is specific to Anscombe's quartet) has an argument `idempotent` that controls how the rotation is performed. In the special case where the input dataset already has the desired summary statistics, using `idempotent = TRUE` ensures that the output dataset is the same as the input dataset.
### Installation
To get the current released version from CRAN:
```{r installation, eval = FALSE}
install.packages("anscombiser")
```
### Vignette
See `vignette("intro-to-anscombiser", package = "anscombiser")` for an overview of the package.