MergeObs {HYPEtools} | R Documentation |
Merge two HYPE observation data frames
Description
Function to merge two HYPE observation data frames, with handling of overlapping time periods and time periods gaps as well as merging of common columns.
Usage
MergeObs(x, y)
Arguments
x , y |
Data frames containing observation timeseries data. Typically imported using |
Details
MergeObs
handles time steps of different lengths (e.g. daily, hourly), but requires identical time
step lengths from both inputs data frames.
In case of common columns (identical date and SUBID combinations in x
and y
),
values from columns in x
will take precedence, and values from y
will only be added if
x
values are missing.
Value
MergeObs
returns a data frame with merged Obs data.
Examples
# Import dummy data, add new observations to second Obs table, and merge
te1 <- ReadObs(filename = system.file("demo_model", "Tobs.txt", package = "HYPEtools"))
te2 <- ReadObs(filename = system.file("demo_model", "Tobs.txt", package = "HYPEtools"))
te2$X0000[1:365] <- runif(n = 365, -20, 25)
MergeObs(x = te1, y = te2)
[Package HYPEtools version 1.6.2 Index]