Title: | 'calendR' Fork with Additional Features (Backwards Compatible) |
---|---|
Description: | Fork of 'calendR' R package to generate ready to print calendars with 'ggplot2' (see <https://r-coder.com/calendar-plot-r/>) with additional features (backwards compatible). 'calendRio' provides a 'calendR()' function that serves as a drop-in replacement for the upstream version but allows for additional parameters unlocking extra functionality. |
Authors: | José Carlos Soage González [aut, cph], Natalia Pérez Veiga [aut, cph], Marcel Schilling [aut, cph, cre] |
Maintainer: | Marcel Schilling <[email protected]> |
License: | AGPL (>= 3) |
Version: | 0.2.1 |
Built: | 2024-12-21 17:24:00 UTC |
Source: | CRAN |
Create ready to print monthly and yearly calendars. The function allows personalizing colors (even setting a gradient color scale for a full month or year), texts and fonts. In addition, for monthly calendars you can also add text on the days and moon phases.
calendR( year = format(Sys.Date(), "%Y"), month = NULL, from = NULL, to = NULL, start = c("S", "M"), orientation = c("portrait", "landscape"), title, title.size = 20, title.col = "gray30", subtitle = "", subtitle.size = 10, subtitle.col = "gray30", text = "", text.pos = NULL, text.size = 4, text.col = "gray30", special.days = NULL, special.col = "gray90", gradient = FALSE, low.col = "white", col = "gray30", lwd = 0.5, lty = 1, font.family = "sans", font.style = "plain", day.size = 3, days.col = "gray30", weeknames, weeknames.col = "gray30", weeknames.size = 4.5, week.number = FALSE, week.number.col = "gray30", week.number.size = 8, monthnames, months.size = 10, months.col = "gray30", months.pos = 0.5, mbg.col = "white", legend.pos = "none", legend.title = "", bg.col = "white", bg.img = "", margin = 1, ncol, lunar = FALSE, lunar.col = "gray60", lunar.size = 7, pdf = FALSE, doc_name = "", papersize = "A4" )
calendR( year = format(Sys.Date(), "%Y"), month = NULL, from = NULL, to = NULL, start = c("S", "M"), orientation = c("portrait", "landscape"), title, title.size = 20, title.col = "gray30", subtitle = "", subtitle.size = 10, subtitle.col = "gray30", text = "", text.pos = NULL, text.size = 4, text.col = "gray30", special.days = NULL, special.col = "gray90", gradient = FALSE, low.col = "white", col = "gray30", lwd = 0.5, lty = 1, font.family = "sans", font.style = "plain", day.size = 3, days.col = "gray30", weeknames, weeknames.col = "gray30", weeknames.size = 4.5, week.number = FALSE, week.number.col = "gray30", week.number.size = 8, monthnames, months.size = 10, months.col = "gray30", months.pos = 0.5, mbg.col = "white", legend.pos = "none", legend.title = "", bg.col = "white", bg.img = "", margin = 1, ncol, lunar = FALSE, lunar.col = "gray60", lunar.size = 7, pdf = FALSE, doc_name = "", papersize = "A4" )
year |
Calendar year. By default uses the current year. |
month |
Month of the year or |
from |
Custom start date of the calendar. If |
to |
Custom end date of the calendar. |
start |
|
orientation |
The calendar orientation: |
title |
Title of the the calendar. If not supplied is the year and the month, or the year if |
title.size |
Size of the main title. |
title.col |
Color of the main title. |
subtitle |
Subtitle of the calendar in italics (optional). |
subtitle.size |
Font size of the subtitle. |
subtitle.col |
Color of the subtitle. |
text |
Character vector of texts to be added on the calendar. Only for monthly calendars. |
text.pos |
Numeric vector containing the number of days of the month where to add the texts of the |
text.size |
Font size of the texts added with the |
text.col |
Color of the texts added with the |
special.days |
Numeric vector indicating the days to color or |
special.col |
Color for the days indicated in special.days. If |
gradient |
Boolean. If |
low.col |
If |
col |
Color of the lines of the calendar. |
lwd |
Line width of the calendar. |
lty |
Line type of the calendar. If |
font.family |
Font family of all the texts. |
font.style |
Style of all the texts and numbers except the subtitle. Possible options are |
day.size |
Font size of the number of the days. |
days.col |
Color of the number of the days. |
weeknames |
Character vector with the names of the days of the week starting on Monday. By default they will be in the system locale. |
weeknames.col |
Color of the names of the days. |
weeknames.size |
Size of the names of the days. |
week.number |
If |
week.number.col |
If |
week.number.size |
If |
monthnames |
Character vector with the names of the months of the calendar. By default they will be upper case and in the system locale. |
months.size |
Font size of the names of the months. |
months.col |
If |
months.pos |
Horizontal align of the month names. Defaults to 0.5 (center). |
mbg.col |
Background color of the month names. Defaults to "white". |
legend.pos |
If |
legend.title |
If |
bg.col |
Background color of the calendar. Defaults to "white". |
bg.img |
Character string containing the URL or the local directory of a image to be used as background. |
margin |
Numeric. Allows controlling the margin of the calendar. |
ncol |
Numeric. Controls the number of columns of the yearly calendar. Overrides the default values for "landscape" and "portrait" orientation. |
lunar |
Boolean. If |
lunar.col |
If |
lunar.size |
If |
pdf |
Boolean. If |
doc_name |
If |
papersize |
PDF paper size. Possible options are |
A ggplot
object containing the requested calendar.
Soage González, José Carlos.
Maintainer: José Carlos Soage González. [email protected]
# Calendar of the current year calendR() # Calendar of July, 2005, starting on Monday calendR(year = 2005, month = 7, start = "M", subtitle = "Have a nice day") # Create ready to print monthly calendars for all the months of the current year # with week starting on Sunday invisible(sapply(1:12 , function(i) calendR(month = i, pdf = TRUE, doc_name = file.path(tempdir(), paste0("myCalendar", i , ".pdf")))))
# Calendar of the current year calendR() # Calendar of July, 2005, starting on Monday calendR(year = 2005, month = 7, start = "M", subtitle = "Have a nice day") # Create ready to print monthly calendars for all the months of the current year # with week starting on Sunday invisible(sapply(1:12 , function(i) calendR(month = i, pdf = TRUE, doc_name = file.path(tempdir(), paste0("myCalendar", i , ".pdf")))))