plot.D3partitionR: Plot D3partitionR object

Description Usage Arguments Examples

Description

Plot D3partitionR object

Usage

1
2
3
## S3 method for class 'D3partitionR'
plot(x, width = NULL, height = NULL,
  elementId = NULL, sizingPolicy = NULL, ...)

Arguments

x

A D3partitionR object to plot

width

width of the widget in pixel/percent

height

height of the widget in pixel/percent

elementId

html id of the widget

sizingPolicy

sizing policy

...

parameters for method consistency

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
require(titanic)
require(data.table)
## Reading data
titanic_data = data.table(titanic::titanic_train)

##Agregating data to have unique sequence for the 4 variables
var_names=c('Sex','Embarked','Pclass','Survived')
data_plot=titanic_data[,.N,by=var_names]
data_plot[,(var_names):=lapply(var_names,function(x){data_plot[[x]]=paste0(x,' ',data_plot[[x]])
})]

## Plotting the chart
library("magrittr")
d3=D3partitionR() %>%
 add_data(data_plot,count = 'N',steps=c('Sex','Embarked','Pclass','Survived')) %>%
 add_title('Titanic')
## Not run: 
plot(d3)

## End(Not run)

Example output

Loading required package: titanic
Loading required package: data.table

D3partitionR documentation built on May 2, 2019, 6:36 a.m.