Learn R Programming

SeaVal (version 1.1.1)

combine: Combine two data tables

Description

Function for combining two data tables, e.g. with predictions and observations. This is a user-friendly wrapper for merge. It guesses the columns to merge by (the dimension variables contained in both data tables) and adds some warnings when merges are attempted that are likely not correctly specified by the user.

Usage

combine(dt1, dt2, ...)

Value

The merged data table

Arguments

dt1

first data table

dt2

second data table

...

passed on to data.table::merge

Examples

Run this code
# merge ECMWF-forecasts and CHIRPS observations:
dt = ecmwf_monthly[month == 11]
setnames(dt,'prec','forecast') # forecasts and observations both have a column 'prec'
dt_new = combine(dt,chirps_monthly)

Run the code above in your browser using DataLab