Lays timeslice-indexed values on a 2-D grid whose axes follow the calendar
structure: the finest timeframe becomes the y-axis, the next-finest the
x-axis, and any coarser level(s) become facets — e.g. for a d365_h24
calendar, x = day-of-year, y = hour-of-day. Useful for load curves,
renewable profiles, prices, and other sub-annual series.
Usage
plot_heatmap(
object,
calendar = NULL,
value = NULL,
facet = NULL,
palette = "D",
name = NULL
)Arguments
- object
A
data.framewith atimeslicecolumn and a numeric value column, a named numeric vector (names are timeslices), or acalendarobject (then the timesliceshare— orvaluecolumn — is shown).- calendar
A
calendarobject giving the layout (matched toxby timeslice), or a format string (e.g."d365_h24"). IfNULL, the format is guessed from the timeslice names withtsl_guess_format().- value
Name of the value column in
x(defaults to the single numeric column, orsharefor a calendar).- facet
Optional timeframe level(s) to facet by.
"month"over a day-of-year format splits the year into monthly panels (x = day-of-month).- palette
Viridis color option for the fill scale.
- name
Legend title (defaults to the value name).
Examples
if (FALSE) { # \dontrun{
data("calendars", package = "energyRt")
cal <- calendars$d365_h24
prof <- data.frame(timeslice = cal@timetable$timeslice,
load = runif(nrow(cal@timetable)))
plot_heatmap(prof, calendar = cal, value = "load")
plot_heatmap(prof, calendar = cal, value = "load", facet = "month")
} # }
