context("test-r-plottime")
testthat::test_that("plotTime is correctly constructed", {
df <- simData(25, 1)
p <- plotTime(df, timespan = "DayWeekName")
expect_true(ggplot2::is.ggplot(p))
expect_equal(length(p$layers), 2)
expect_equal(p$labels$y, "Number of workouts")
expect_equal(p$labels$title, "Workouts per DayWeekName")
geoms <- sapply(p$layers, function(x) class(x$geom)[1])
expect_equal(geoms, c("GeomCol", "GeomText"))
# expect_equal(p$layers[[2]]$mapping$label, "Count")
})
# plotTime(df, timespan = "Year")
# plotTime(df, timespan = "Month")
# plotTime(df, timespan = "Week")
# plotTime(df, timespan = "DayWeekName")
#
# plotTimespans(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.