View source: R/function_MergeXobs.R
MergeXobs | R Documentation |
Function to merge two Xobs data frames, with handling of overlapping time periods and time periods gaps as well as merging of common columns.
MergeXobs(x, y, comment = "")
x , y |
Data frames of class |
comment |
Character string, will be added to the result as attribute |
MergeXobs
handles time steps of different lengths (e.g. daily, hourly), but requires identical time
step lengths from both inputs data frames. The functions expects data frames of class HypeXobs
or data frames with comparable structure and will throw a warning if the class attribute is missing.
In case of common columns (identical observation variable 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
MergeXobs
returns a data frame with attributes for Xobs data.
# Import dummy data, add new observations to second Xobs table
te1 <- ReadXobs(filename = system.file("demo_model", "Xobs.txt", package = "HYPEtools"))
te2 <- ReadXobs(filename = system.file("demo_model", "Xobs.txt", package = "HYPEtools"))
te2$WSTR_40541[1:10] <- runif(n = 10, 50, 100)
MergeXobs(x = te1, y = te2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.