plotAvgTemperaturesByYear: Plot of average temperatures by year

Description Usage Arguments Details Value Examples

View source: R/visualize.R

Description

plotAvgTemperaturesByYear plots the average temperature by year in a line graph.

Usage

1
plotAvgTemperaturesByYear(avg_temperatures, place = "Nottingham")

Arguments

avg_temperatures

Data.frame. Has years and their corresponding average temperature.

place

String. It's assumed this function is called with the nottem built-in dataset. This dataset records the temperatures in Nottingham. Nottingham is the default argument. You can override this argument if the need arises.

Details

This function plots the average temperature by year. It also automatically updates the title so there's no need to specify the title yourself.

Value

ggplot object

Examples

1
2
3
avg_temperatures <- data.frame(year = c(1920, 1921, 1922, 1923),
                               avgTemperature = c(5, 10, 8, 9))
plotAvgTemperaturesByYear(avg_temperatures)

IsaacVerm/reproseries documentation built on Jan. 9, 2020, 1:27 a.m.