radviz: Make a radviz

Description Usage Arguments Examples

View source: R/radviz.R

Description

Make a radviz

Usage

1
2
3
radviz(data, draw_links = TRUE, zoom_factor = 1, dot_radius = 4,
  use_repulsion = FALSE, diameter = 400, margin = 50, width = NULL,
  height = NULL)

Arguments

data

data.frame to use

draw_links

whether to draw links or not

zoom_factor

gets the dimension nodes on a bigger radius than the panel, to pull nodes away from the center

dot_radius

radius of each dot

use_repulsion

special repulsion effect to spread the nodes from each others so they can be better selected

diameter

size of the circle (should be <= width if that is set to pixels)

margin

margin around the circular panel

width, height

height & width of the widget

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# motor vehicles

mtcars_1 <- dplyr::add_rownames(mtcars, var="car")

radviz(mtcars_1, diameter=600, margin=100,
       use_repulsion=TRUE, draw_links=TRUE,
       width=600, height=500) %>%
  add_dimensions(c("mpg", "cyl", "disp", "hp", "drat", "wt",
                   "qsec", "vs", "am", "gear", "carb")) %>%
  add_color("cyl") %>%
  add_tooltip("function(d) { return d.car; }")

# motor vehicles deaths

cardeaths <- data.frame(as.matrix(Seatbelts),
                        year=substring(zoo::as.yearmon(time(Seatbelts)), 5, 7))

radviz(cardeaths, diameter=600, margin=100,
       use_repulsion=FALSE, draw_links=FALSE,
       width=600, height=500) %>%
  add_dimensions(c("DriversKilled", "PetrolPrice", "VanKilled")) %>%
  add_color("year") %>%
  add_tooltip("function(d){ return d.year; }")

hrbrmstr/radviz documentation built on May 16, 2017, 11:20 p.m.