segsmooth {HS}R Documentation

Smoothing data using the moving average method for the homogeneous segmentation.

Description

A center aligned moving window is used for the moving average method.

Usage

segsmooth(var = "deflection", range = 11, data)

Arguments

var

A character of the name of a variable in a dataset, such as a road pavement performance indicator.

range

A number of the size of moving window. An odd number is required.

data

A data frame of monitoring data.

Examples

# preprocessing
testdata <- tsdwa[1:500,]
testdata <- preprocessing(var = "Deflection", location = "SLK.start", data = testdata)
# smoothing
testdata <- segsmooth(var = "Deflection", range = 11, data = testdata)
# plot
plot(testdata$SLK.start, testdata$Deflection, type = "l",
     col = "lightblue", xlab = "location", ylab = "deflection")
lines(testdata$SLK.start, testdata$smooth.Deflection)


[Package HS version 1.1 Index]