segcompare {HS}R Documentation

Segments comparison of different homogeneous segmentations methods.

Description

Segments comparison of different homogeneous segmentations methods.

Usage

segcompare(start = "SLK.start", end = "SLK.end", var = "deflection",
                  data, segid.matrix, methods = NULL)
## S3 method for class 'segcompare'
print(x, ...)
## S3 method for class 'segcompare'
plot(x, ...)

Arguments

start

A character of start location name of a spatial line.

end

A character of end location name of a spatial line.

var

A character or a character vector of variable names, such as a road pavement performance indicator.

data

A list of segmentation result.

segid.matrix

A matrix of segmentations.

methods

A vector of segmentation method names, default NULL.

x

A list of segments comparison result.

...

Ignore

Examples

testdata <- tsdwa[1:300, ]
testdata$length <- testdata$SLK.end - testdata$SLK.start
variable <- c("Curvature", "Deflection", "BLI")

seg1 <- hs(start = "SLK.start", end = "SLK.end", var = variable,
           testdata, method = "shs", range = c(0.1, 0.5)) # 0.3 s
seg2 <- hs(start = "SLK.start", end = "SLK.end", var = variable,
           testdata, method = "cda", range = c(0.1, 0.5)) # 0.7 s
seg3 <- hs(start = "SLK.start", end = "SLK.end", var = variable,
           testdata, method = "mcv", range = c(0.1, 0.5)) # 0.6 s
segid.matrix <- cbind(seg1$seg.id, seg2$seg.id, seg3$seg.id)

data(segid.matrix)
cp <- segcompare(start = "SLK.start", end = "SLK.end", var = variable,
                 testdata, segid.matrix, methods = c("SHS", "CDA", "MCV")) # 4.8 s
cp
plot(cp)


[Package HS version 1.1 Index]