merge {HYPEtools} | R Documentation |
Merge HypeGeoData object
Description
Merge an imported HYPE GeoData table of class link{HypeGeoData}
with another data frame.
Usage
## S3 method for class 'HypeGeoData'
merge(x, y, all.x = TRUE, sort = NA, ...)
Arguments
x |
|
y |
Data frame, with mandatory |
all.x |
Logical, keep all rows from |
sort |
Logical, result sorting by |
... |
Arguments passed to S3 method for data frames, see |
Details
merge.HypeGeoData
allows to merge new columns to an existing HYPE GeoData table, while preserving the HypeGeoData
class attribute. Duplicate columns are marked with a ".y"
-suffix for the merged y
data frame.
The following arguments of the default method are hard-coded:
by, by.x, by.y
, set to"SUBID"
suffixes
, set toc("", ".y")
The method warns if any of these arguments is supplied by the user. To override, use the GeoData table as argument y
or
call the data frame method explicitly (merge.data.frame()
).
Value
A HypeGeoData
data frame.
See Also
merge
, the S3 generic function.
Examples
# import and create dummy data
te1 <- ReadGeoData(filename = system.file("demo_model",
"GeoData.txt", package = "HYPEtools"))
te2 <- data.frame(SUBID = sample(x = te1$SUBID, size = 10),
loc_vol = runif(n = 10, 10, 50))
merge(x = te1, y = te2)