alter: Dataset

Description Usage Arguments Examples

View source: R/data.R

Description

Dataset with state management https://github.com/antvis/data-set

Usage

1
2
alter(data, ..., source = NULL, .rename = TRUE, .rows = TRUE,
  .return = NULL)

Arguments

data

A data.frame to alter.

...

Altering options.

source

A list of source options.

.rename

Whether to rename the columns of the altered data.frame (recommended).

.rows

Wheter to return the whole altered object or just the rows.

.return

Method to return, i.e."rows".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
head(fruits)

fr <- fruits %>% 
  dplyr::mutate(value = value * 100) %>% 
  dplyr::select(name = fruit, value) %>% 
  alter(type = "waffle", maxCount = 500, rows = 12) 

head(fr)

g2(fr, asp(x, y, shape = "square", size = 10, color = name)) %>% 
  fig_point(axes = FALSE) %>% 
  gauge_axis(x, FALSE)

JohnCoene/g2r documentation built on March 6, 2021, 8:11 p.m.