Learn R Programming

simulariatools (version 3.1.0)

plotAvgTemp: 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
)

Value

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

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 the 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.

See Also

plotStabilityClass(), plotAvgRad()

Examples

Run this code
# 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")

Run the code above in your browser using DataLab