Skip to content

Instantly share code, notes, and snippets.

@mcguinlu
Last active March 3, 2020 10:11
Show Gist options
  • Save mcguinlu/809450b5443128b3afc99a12572e1c27 to your computer and use it in GitHub Desktop.
Save mcguinlu/809450b5443128b3afc99a12572e1c27 to your computer and use it in GitHub Desktop.
library(robvis)
library(ggplot2)
#Define colours (cochrane)
low_colour <- "#02C100"
concerns_colour <- "#E2DF07"
high_colour <- "#BF0000"
critical_colour <- "#820000"
ni_colour <- "#4EA1F7"
# Draw basic plot, and then update scales to use Some concerns rather than Unclear
rob_traffic_light(data = data_rob1, tool = "ROB1") +
ggplot2::scale_colour_manual(
values = c(
l = low_colour,
s = concerns_colour,
h = high_colour,
c = critical_colour,
n = ni_colour
),
labels = c(
l = "Low",
s = "Some concerns", # This changes it from "Unclear" to "Some concerns"
h = "High",
c = "Critical",
n = "No information"
)
) +
ggplot2::scale_shape_manual(
values = c(
l = 43,
s = 45,
h = 120,
c = 33,
n = 63
),
labels = c(
l = "Low",
s = "Some concerns", # This changes it from "Unclear" to "Some concerns"
h = "High",
c = "Critical",
n = "No information"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment