# NOT RUN {
# the minimum command to generate a plot
newggslopegraph(newcancer, Year, Survival, Type)
# adding a title which is always recommended
newggslopegraph(newcancer, Year, Survival, Type,
Title = "Estimates of Percent Survival Rates",
SubTitle = NULL,
Caption = NULL
)
# simple formatting changes
newggslopegraph(newcancer, Year, Survival, Type,
Title = "Estimates of Percent Survival Rates",
LineColor = "darkgray",
LineThickness = .5,
SubTitle = NULL,
Caption = NULL
)
# complex formatting with recycling and wider labels see vignette for more examples
newggslopegraph(newcancer, Year, Survival, Type,
Title = "Estimates of Percent Survival Rates",
SubTitle = "Based on: Edward Tufte, Beautiful Evidence, 174, 176.",
Caption = "https://www.edwardtufte.com/bboard/q-and-a-fetch-msg?msg_id=0003nk",
LineColor = c("black", "red", "grey"),
LineThickness = .5,
WiderLabels = TRUE
)
# not a great example but demonstrating functionality
newgdp$rGDP <- round(newgdp$GDP)
newggslopegraph(newgdp,
Year,
rGDP,
Country,
LineColor = c(rep("grey", 3), "red", rep("grey", 11)),
DataTextSize = 3,
DataLabelFillColor = "gray",
DataLabelPadding = .2,
DataLabelLineSize = .5
)
# }
Run the code above in your browser using DataLab