This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
# Create a simple data frame for testing | |
df <- data.frame(POSIXtime = seq(as.POSIXct('2013-08-02 12:00'), | |
as.POSIXct('2013-08-06 05:00'), len = 45), | |
x = seq(45)) | |
# The Subset Examples | |
# | |
# All data on 2013-08-06 | |
sub.1 <- subset(df, format(POSIXtime,'%d')=='06') |
NewerOlder