merge | R Documentation |
Merge an imported HYPE GeoData table of class link{HypeGeoData}
with another data frame.
## S3 method for class 'HypeGeoData'
merge(x, y, all.x = TRUE, sort = NA, ...)
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 |
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 to c("", ".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()
).
A HypeGeoData
data frame.
merge
, the S3 generic function.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.