Skip to content

Instantly share code, notes, and snippets.

@uribo
Last active January 12, 2022 04:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uribo/a270d0b3ebdebadb6090 to your computer and use it in GitHub Desktop.
Save uribo/a270d0b3ebdebadb6090 to your computer and use it in GitHub Desktop.
Hadley Wickham's Data Science Cycle with R
library(DiagrammeR)
library(remoji)
nodes <-
create_nodes(
nodes = c(
paste0(emoji("floppy_disk"), "Import"),
paste0(emoji("repeat"), "Tidy"),
paste(
paste0(
emoji("microscope"),
"Exploratory data analysis",
emoji("flashlight"),
"\n\n"
),
paste0(emoji("bar_chart"), "Visualise"),
paste0(emoji("wrench"), "Transform"),
paste0(emoji("100"), "Model")
),
paste0(emoji("white_flower"), "Communicate"),
paste0(emoji("rocket"), "Automate")
),
label = TRUE,
fontname = "Helvetica",
tooltip = c("", "", "{dplyr}, {ggplot2}, {broom}, {purrr}"),
type = "upper",
style = "filled",
color = "#F9F8F2",
shape = c("box", "box", "ellipse", "box", "box")
)
edges <-
create_edges(
from = c(
paste0(emoji("floppy_disk"), "Import"),
paste0(emoji("repeat"), "Tidy"),
paste(
paste0(
emoji("microscope"),
"Exploratory data analysis",
emoji("flashlight"),
"\n\n"
),
paste0(emoji("bar_chart"), "Visualise"),
paste0(emoji("wrench"), "Transform"),
paste0(emoji("100"), "Model")
),
paste(
paste0(
emoji("microscope"),
"Exploratory data analysis",
emoji("flashlight"),
"\n\n"
),
paste0(emoji("bar_chart"), "Visualise"),
paste0(emoji("wrench"), "Transform"),
paste0(emoji("100"), "Model")
),
paste0(emoji("rocket"), "Automate")
),
to = c(
paste0(emoji("repeat"), "Tidy"),
paste(
paste0(
emoji("microscope"),
"Exploratory data analysis",
emoji("flashlight"),
"\n\n"
),
paste0(emoji("bar_chart"), "Visualise"),
paste0(emoji("wrench"), "Transform"),
paste0(emoji("100"), "Model")
),
paste0(emoji("white_flower"), "Communicate"),
paste0(emoji("rocket"), "Automate"),
paste0(emoji("white_flower"), "Communicate")
),
length = c(180, 240, 160, 200, 160),
rel = c("{readr}\n{readxl}\n{haven}", "{tidyr}", NULL),
color = "grey",
width = 2
)
render_graph(
create_graph(nodes_df = nodes,
edges_df = edges),
output = "visNetwork",
# grViz, vivagraph, visNetwork
layout = "constant"
)
library(DiagrammeR)
nodes <-
create_nodes(
nodes = c("Data frames", "Lists", "Models"),
label = TRUE,
fontname = "Helvetica",
type = "lower",
style = "filled",
tooltip = c("{tidyr}", ""),
color = "#F9F8F2",
shape = "box")
edges <-
create_edges(
from = c("Data frames", "Lists", "Models"),
to = c("Lists", "Data frames", "Data frames"),
rel = c("{dplyr}", "{purrr}", "{broom}"),
color = "grey"
)
render_graph(
create_graph(nodes_df = nodes,
edges_df = edges),
output = "visNetwork",
layout = "constant"
)
@uribo
Copy link
Author

uribo commented Mar 26, 2016

viewer_zoom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment