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.
- Host: GitHub
- URL: https://github.com/andrie/discretizer
- Owner: andrie
- License: other
- Created: 2019-04-17T07:31:35.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T20:28:01.000Z (about 6 years ago)
- Last Synced: 2025-02-14T13:16:58.760Z (3 months ago)
- Topics: r, r-package, rstats
- Language: R
- Homepage:
- Size: 419 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
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%"
)
```
# discretizerThe 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")
```
## ExampleTo 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()
```