context('geom_timeline')
test_that('geom_timeline TRUE', {
dat <-NOAA_quakes
plot1 <- NOAA_quakes%>%eq_clean_data()%>%
dplyr::filter(COUNTRY %in% c('MEXICO')) %>%
dplyr::filter(DATE > '2010-01-01') %>%
ggplot2::ggplot() +
geom_timeline(aes(x = DATE, y = COUNTRY, size = as.numeric(EQ_PRIMARY),
color = as.numeric(TOTAL_DEATHS)))
expect_s3_class(plot1, 'ggplot')
expect_length(plot1$layers, 1)
plot2 <- NOAA_quakes%>%eq_clean_data()%>%
dplyr::filter(COUNTRY %in% c('MEXICO','USA')) %>%
dplyr::filter(DATE > '2010-01-01') %>%
ggplot2::ggplot() +
geom_timeline(aes(x = DATE, y = COUNTRY, size = as.numeric(EQ_PRIMARY),
color = as.numeric(TOTAL_DEATHS)))
expect_length(plot2$labels, 4)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.