# --- Create dummy data
mydat <- data.frame(TimeCode = seq(as.Date("2008/1/1"), as.Date("2017/1/1"), "years"),
YValue = sample(1:79/10, 20),
YLabel = rep(c("Acute", "Chronic"), each = 10))
# --- Plot the dummy data
plotTSGrouped(mydat,
xvar = "TimeCode",
xlabel = "Year",
yvar = "YValue",
ylabel = "Rate per 100 000 population",
group = "YLabel",
log10_scale = TRUE,
xvar_format = "%Y",
xvar_breaks = "1 year")
# --- Create dummy data
mydat <- data.frame(TimeCode = rep(seq(as.Date("2008/1/1"), as.Date("2017/1/1"), "years"), 5),
YValue = c(sample(1:50/10, 10),
sample(1:100/10, 10),
sample(1:300/10, 10),
sample(1:400/10, 10),
sample(1:500/10, 10)),
YLabel = rep(c("United Kingdom",
"France",
"Spain",
"Netherlands",
"Belgium"), each = 10))
# --- Plot the dummy data
plotTSGrouped(mydat,
xvar = "TimeCode",
xlabel = "Year",
yvar = "YValue",
ylabel = "Rate per 100 000 population",
group = "YLabel",
log10_scale = FALSE,
xvar_format = "%Y",
xvar_breaks = "1 year")
Run the code above in your browser using DataLab