knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of ggDarwin is to ...
You can install the development version of ggDarwin like so:
install.packages("remotes") remotes::install_github("edward-burn/ggDarwin")
Before ggDarwin
library(ggDarwin) library(dplyr) library(ggplot2) library(lubridate) Sys.setlocale("LC_TIME", "English") # Example 1----- # Plot y.var <- economics$uempmed y.name <- "Unemployment" economics %>% ggplot()+ geom_point(aes(date,y=y.var))+ geom_line(aes(date,y=y.var), size=0.8)+ scale_y_continuous(name= y.name)+ xlab("")
And now with ggDarwin
time <- "year" # Time units (day, month, week or year) interval <- 5 # Interval between x-axis breaks start <- min(economics$date) # Start date end <- max(economics$date) # End date economics %>% ggplot()+ geom_point(aes(date,y=y.var))+ geom_line(aes(date,y=y.var), size=0.8)+ scale_y_continuous(name= y.name)+ xlab("")+ scale_x_date_darwin(time,start,end, interval)+ theme_darwin()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.