This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(V8) | |
# Create function to generate palette of visually different colors | |
hex_palette <- function(no_colors, | |
hue_range = NULL, | |
chroma_range = NULL, | |
lightness_range = NULL){ | |
pal <- function(col, border = "light gray", ...){ | |
n <- length(col) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install.packages("downloader") | |
# devtools::install_github("rich-iannone/DiagrammeR") | |
# devtools::install_github("jeroenooms/V8") | |
library("downloader") | |
library("DiagrammeR") | |
library("V8") | |
# Create a function that uses the 'chromatography' JS library to generate a random | |
# set of colors from the CIE Lab color space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(DiagrammeR) | |
require(stringr) | |
# Animation test | |
nodes <- c("a", "b", "c") # must be named 'nodes' and should have unique values | |
nodes_df <- data.frame(nodes) | |
edge_from <- c("a", "a", "b") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Installation | |
#install.packages("devtools") | |
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
# Create and render an empty graph | |
empty_graph <- create_graph() | |
render_graph(empty_graph, output = "visNetwork") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
library(magrittr) | |
# Create a graph | |
graph <- | |
create_graph() %>% | |
set_global_graph_attr("graph", "rankdir", "LR") %>% | |
add_node("A") %>% add_node("B") %>% add_node("C") %>% | |
add_node("D") %>% add_node("E") %>% add_node("F") %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
library(DiagrammeRsvg) | |
library(magrittr) | |
# Create three groups (Setosa, Versicolor, and Virginica) | |
# of x,y datapoints for petal length (x) and petal width (y) | |
setosa <- | |
create_xy_pts( | |
series_label = "Setosa", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
library(DiagrammeRsvg) | |
library(magrittr) | |
# Read in the data | |
sp500 <- read.csv(system.file("examples/sp500.csv", | |
package = "DiagrammeR"), | |
stringsAsFactors = FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load in several packages | |
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
library(DiagrammeRsvg) | |
library(magrittr) | |
library(stationaRy) | |
library(dplyr) | |
# Get the daily rainfall values (in mm) during 2015 at | |
# the Vancouver Internation Airport (YVR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grViz(" | |
graph severalranks { | |
node [shape = circle, fixedsize = true, fontcolor = '#555555', | |
fontname = Helvetica, fontsize = 7, style = filled, | |
fillcolor ='#AAAAAA', color='#555555', width = 0.12, | |
height = 0.12, nodesep = 0.1] | |
edge [color = '#AAAAAA'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grViz(" | |
graph severalranks { | |
node [shape = circle, fixedsize = true, fontcolor = '#555555', | |
fontname = Helvetica, fontsize = 7, style = filled, | |
fillcolor ='#AAAAAA', color='#555555', width = 0.12, | |
height = 0.12, nodesep = 0.1] | |
edge [color = '#AAAAAA'] |
OlderNewer