Learn R Programming

Laurae (version 0.0.0.9001)

interactive.eda_d3js: Interactive Dashboard for Exploratory Data Analysis (d3js)

Description

This function runs an interactive dashboard which allows to explore data via 3djs and NVD3. Unlike its counterpart interactive.eda_ggplot, using 3djs is not efficient for large data (10K+ observations) and automated smart plotting is not available. In addition, the filtering method is currently broken. This function is not recommended if you want d3js plot and you should use interactive.eda_plotly.

Usage

interactive.eda_d3js(data, type = "scatterChart",
  dep_var = colnames(data)[1], indep_var = "None", group_var = "None",
  filter_var = "None", plot_width = 1500, plot_height = 820,
  f_back = "red", side_width = 300)

Arguments

data
Type: data.table (preferred) or data.frame. The data you want to explore. Using a data.table increases the processing speed.
type
Type: character. The type of plot requested to d3js nvds. You may choose between "lineChart", "scatterChart", "stackedAreaChart", "discreteBarChart", "multiBarChart", "multiBarHorizontalChart", "linePlusBarChart", "cumulativeLineChart", "lineWithFocusChart", "pieChart", "bulletChart". Defaults to "scatterChart".
dep_var
Type: character (currently overriden). The dependent variable to plot. Defaults to colnames(data)[1], a reference to the first column of data.
indep_var
Type: character (currently overriden). The independent variable to plot. Defaults to "None".
group_var
Type: character (currently overriden). The grouping variable to plot. Defaults to "None".
filter_var
Type: character (feature currently broken). The filtering variable to plot. Defaults to "None".
plot_width
Type: numeric. The width for the plot. Defaults to 1500, which fits nicely Full HD screens (1920 vertical pixels).
plot_height
Type: numeric. The height for the plot. Defaults to 820, which fits nicely Full HD screens (1080 vertical pixels).
f_back
Type: character. A background color character for the header. Defaults to "red".
side_width
Type: numeric. The width of the sidebar containing variable names. Defaults to 300.

Value

Nothing

Details

Plotting is done using rCharts, which must be loaded before running this function. There are issues if you open this in Internet Explorer 9 or under. The colors (header: f_back) allowed are the following:
blue
blue color
black
black color
purple
purple color
green
green color
red
red color
yellow
yellow color

Examples

Run this code
## Not run: ------------------------------------
# library(shiny)
# library(shinydashboard)
# library(rCharts)
# library(datasets)
# hair_eye <- as.data.frame(HairEyeColor)
# interactive.eda_d3js(data = hair_eye,
#                      type = "multiBarChart",
#                      dep_var = "Hair", #ignored
#                      indep_var = "Freq", #ignored
#                      group_var = "Sex", #ignored
#                      plot_width = 600,
#                      plot_height = 420,
#                      f_back = "red",
#                      side_width = 300)
## ---------------------------------------------

Run the code above in your browser using DataLab