Learn R Programming

SpatialVx (version 0.3)

MergeForce: Force Merges in Matched Feature Objects

Description

Force merges in matched feature objects so that, among other things, subsequent analyses are quicker and cleaner.

Usage

MergeForce(x, verbose = FALSE)

Arguments

x
list object of class matched.
verbose
logical, should progress information be printed to the screen.

Value

  • A list object of class matched is returned containing several components and the same attributes as x.
  • match.messageA character string stating how features were matched with (merged) apended.
  • match.typecharacter of length 2 naming the original matching funciton used and this function to note that the features have been forced to be merged/clustered together.
  • matchestwo-column matrix with forecast object numbers in the first column and corresponding matched observed features in the second column. If no matches, this will have value integer(0) for each column giving a matrix with dimension 0 by 2.
  • unmatchedlist with components X and Xhat giving the unmatched object numbers, if any, from the observed and forecast fields, resp. If none, the value will be integer(0).
  • Note that all of the same list components of x are passed back, except for special information (which is usually no longer relevant) such as Q (deltamm), criteria, criteria.values, centroid.distances (centmatch)

    Additionally, merges and/or implicit.merges (centmatch) are not included as they have been merged.

Details

Objects returned by functions such as deltamm and centmatch provide information necessary to merge and match features from features objects. In the case of centmatch, only implicit merges are given, and this function creates objects where the implicit merges are forced to be merged. In the case of deltamm, a second pass through might yield better merges/matches in that without a second pass, only features in one field or the other can be merged and matched (not both simultaneously). Using this funciton, and apssing the result back through deltamm can result in subsequent matches of merged features from both fields simultaneously. Moreover, in some cases, it may be more computationally efficient to run this function once for subsequent analyses/plotting.

See Also

For identifying features in a field: FeatureFinder

For merging and/or matching features: deltamm, centmatch, plot.matched

Examples

Run this code
x <- y <- matrix(0, 100, 100)
x[2:3,c(3:6, 8:10)] <- 1
y[c(4:7, 9:10),c(7:9, 11:12)] <- 1

x[30:50,45:65] <- 1
y[c(22:24, 99:100),c(50:52, 99:100)] <- 1

hold <- make.SpatialVx(x, y, field.type="contrived", units="none",
    data.name=c("Example", "x", "y"))

look <- FeatureFinder(hold, smoothpar=0.5)

look2 <- deltamm(look)

look2 <- MergeForce(look2)

data(pert000)
data(pert004)
data(ICPg240Locs)

hold <- make.SpatialVx(pert000, pert004,
    loc=ICPg240Locs, projection=TRUE, map=TRUE, loc.byrow = TRUE,
    field.type="Precipitation", units="mm/h",
    data.name=c("ICP Perturbed Cases", "pert000", "pert004"))

look <- FeatureFinder(hold, smoothpar=10.5, thresh = 5)

look2 <- deltamm(look, verbose = TRUE)

plot(look2)

look3 <- MergeForce(look2)

plot(look3) # same plot as for look2.

look4 <- deltamm(look3, verbose = TRUE) # Nothing changed.

plot(look4) # Nothing changed.

Run the code above in your browser using DataLab