join_to_fcst: Combine data with point forecasts.

View source: R/join_to_fcst.R

join_to_fcstR Documentation

Combine data with point forecasts.

Description

Works in a similar way to the join family of functions, excpet that the join type is specified as an argument.

Usage

join_to_fcst(
  .fcst,
  .join,
  join_type = c("inner", "left", "right", "full", "semi", "anti"),
  by = NULL,
  force_join = FALSE,
  keep_x = TRUE,
  keep_y = FALSE,
  ...
)

Arguments

.fcst

A harp_fcst object.

.join

A data frame to join to each table in the harp_fcst object.

join_type

How to join the data frame. Acceptable values are: "inner", "left", "right", "full", "semi", "anti". See join for more details.

by

Which columns to join by - if set to NULL a natural join will be done, using all variables with common names across .fcst and .join. The default is to join using all common columns in .fcst and .join excluding lat, lon and elev. This is because they may be stored to different levels of precision and the join will thus fail.

force_join

Set to TRUE to force the join to happen even if the units in .fcst and .join are not compatible.

keep_x, keep_y

Where duplicate column names are found, but not used in the join, these arguments are used to indicate whether the duplicate columns from .fcst (keep_x), or .join (keep_y) should be kept. The default is keep_x = TRUE, keep_y = FALSE.

...

Other arguments for join.

Details

This function would typically be used to add a column of observations to the forecast data. If units columns are found in the data, the function will check if the units are the same for both .fcst and .join. If they are not, an error will be thrown and the join will not be done. This behaviour can be overridden with the force_join argument.

Value

The input forecast data frame with column(s) added from .join.


andrew-MET/harpPoint documentation built on Feb. 23, 2023, 1:06 a.m.