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.
Arguments
- x
A
data.framewith aslicecolumn and a numeric value column, a named numeric vector (names are slices), or acalendarobject (then the sliceshare— orvaluecolumn — is shown).- calendar
A
calendarobject giving the layout (matched toxby slice), or a format string (e.g."d365_h24"). IfNULL, the format is guessed from the slice 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(slice = cal@timetable$slice,
load = runif(nrow(cal@timetable)))
plot_heatmap(prof, calendar = cal, value = "load")
plot_heatmap(prof, calendar = cal, value = "load", facet = "month")
} # }
