plotAvgTemp: Plot average temperature

View source: R/plotAvgTemp.R

plotAvgTempR Documentation

Plot average temperature

Description

plotAvgTemp builds a bar plot of time average temperature and two line plots with maximum and minimum temperature.

Usage

plotAvgTemp(
  mydata,
  date = "date",
  temp = "temp",
  avg.time = "1 month",
  ylabel = NULL,
  title = "",
  locale = NULL
)

Arguments

mydata

A dataframe containing data to plot.

date

The name of the column representing date and time. Data must be of class POSIXlt or POSIXct (default = "date"). If timezone is unspecified, it is set to GMT.

temp

Name of the column representing temperature (default = "temp")

avg.time

Defines the time period to average to. Currently the only supported period is "1 month" (default).

ylabel

The label along the y axis. If missing a default label is plotted.

title

Optional plot title

locale

Locale to use for day and month names. Default is current locale. Supported locales are listed in stringi::stri_locale_list(). All other labels are in English by default or in Italian if its locale is specified.

Value

A plot with average, min and max temperature in a given range of time.

See Also

plotStabilityClass(), plotAvgRad()

Examples

# Plot average monthly temperature and curves with monthly maximum and minimum
data(stMeteo)
str(stMeteo)
plotAvgTemp(stMeteo)
# Add a custom title
plotAvgTemp(stMeteo, title = "Monthly temperature")

# Override default locale
plotAvgTemp(stMeteo, avg.time = "1 month", locale = "it_IT")


simulariatools documentation built on Sept. 1, 2025, 5:09 p.m.