An open API service indexing awesome lists of open source software.

https://github.com/andrie/discretizer

Experiments in discretizing data for fast plotting.
https://github.com/andrie/discretizer

r r-package rstats

Last synced: about 1 month ago
JSON representation

Experiments in discretizing data for fast plotting.

Awesome Lists containing this project

README

        

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# discretizer

The goal of discretizer is to discretize data in a data frame (x and y) to a matrix for fast visualizationn

## Installation

You can install the development version from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("andrie/discretizer")
```
## Example

To illustrate discretization, create a strange attractor with 10 million points, and the plot:

(This takes ~10 on my laptop.)

```{r example}
library(magrittr)
library(discretizer)
par(mar = rep(0, 4), mai = rep(0, 4))

c(-0.8, 0.4, -1.1, 0.5, -0.6, -0.1, -0.5, 0.8, 1.0, -0.3, -0.6, -0.3, -1.2, -0.3) %>%
strange_attractor(1e7, 1, 1) %>%
trim_quantiles(q = 0.05) %>%
discretize() %>%
log1p() %>%
recolour("BuPu") %>%
plot()
```