You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
ggdaynight is an R package that adds a day/night pattern to ggplot2 plots. Daytime is represented by rectangles filled with a specifiedday_fill color and nighttime by rectangles filled with a specifiednight_fill color. The pattern is created along the x-axis, which must be a datetime variable.
Installation
You can install the released version ofggdaynight from CRAN:
install.packages("ggdaynight")
You can install the development version ofggdaynight from GitHub with:
# Install devtools if not already installedif (!requireNamespace("devtools", quietly = TRUE)) { install.packages("devtools")}# Install ggdaynight from GitHubdevtools::install_github("GabrielSlPires/ggdaynight")
day_fill: The fill color for daytime rectangles. Defaults to"white".
night_fill: The fill color for nighttime rectangles. Defaults to"grey30".
sunrise: The hour at which daytime starts. Defaults to 6 (6 AM).
sunset: The hour at which nighttime starts. Defaults to 18 (6 PM).
...: Additional arguments passed togeom_rect.
Value
A ggplot2 layer representing the day/night pattern.
Contributing
Please feel free to submit issues and pull requests to the repository. For major changes, please open an issue first to discuss what you would like to change.