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(pointblank) | |
library(log4r) | |
library(blastula) | |
# Create a connection to the game analytics data | |
# This is the `intendo` database | |
con <- | |
DBI::dbConnect( | |
drv = RMariaDB::MariaDB(), | |
dbname = Sys.getenv("DBNAME"), |
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
# 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 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
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 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(DiagrammeR) | |
library(DiagrammeRsvg) | |
library(magrittr) | |
# The CSV file is located inside a zip file at: | |
# https://www.kaggle.com/kaggle/sf-salaries/downloads/ | |
# sf-salaries-release-2015-12-21-03-21-32.zip | |
salaries <- read.csv("Salaries.csv", | |
stringsAsFactors = FALSE) |
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
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 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
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 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
# Installation | |
#install.packages("devtools") | |
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
# Create a graph of border coordinates | |
country_graph <- country_graph() | |
# Read in a CSV with location and population data for cities all over the world |
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
# Installation | |
#install.packages("devtools") | |
devtools::install_github("rich-iannone/DiagrammeR") | |
library(DiagrammeR) | |
# Create a graph of border coordinates for USA, Canada, and Mexico | |
country_graph <- country_graph(iso_a2 = c("US", "CA", "MX")) | |
# Read in a CSV with US city data |
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
# 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 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 the latest version of DiagrammeR from GitHub | |
devtools::install_github("rich-iannone/DiagrammeR") | |
# Ensure that the package is loaded | |
library("DiagrammeR") | |
# So, here's a script that essentially takes an empty graph series, and | |
# creates a new graph on each new day it is triggered. It will create | |
# random nodes each time it's triggered and add those nodes to the graph | |
# belonging to the current day. Throughout the script, '_SELF_' refers |