Skip to contents

Joins weather data to a match data frame and creates derived features. Uses median imputation for missing weather values (neutral contribution).

Usage

add_weather_features(match_data, weather_data = NULL)

Arguments

match_data

data.frame with at least a match_id column.

weather_data

data.frame from load_match_weather(). If NULL, attempts to load from database.

Value

The input data frame with weather feature columns added: temp_avg, wind_avg, precipitation_total, rain_days, is_rain, log_precip, log_wind.