View source: R/function_MergeObs.R
MergeObs | R Documentation |
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.
MergeObs(x, y)
x , y |
Data frames containing observation timeseries data. Typically imported using |
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.
MergeObs
returns a data frame with merged Obs data.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.