Learn R Programming

g2r (version 0.1.0)

alter: Dataset

Description

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

Usage

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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab