Learn R Programming

growR (version 1.3.0)

weighted_temperature_sum: Create a weighted temperature sum

Description

A temperature sum is constructed by summing the average daily temperature for each day, but applying a weight factor of 0.5 for January and 0.75 for February.

Usage

weighted_temperature_sum(temperatures, negative = FALSE)

Value

Weighted temperature sum.

Arguments

temperatures

vector Daily average temperatures in degree Celsius.

negative

boolean Whether to include negative temperature values in the summation. By default, negative values are set to 0, meaning that the temperature sum is monotonically increasing.

Examples

Run this code
# Use fake temperatures
ts = rep(2, 365)
weighted_temperature_sum(ts)

Run the code above in your browser using DataLab