# set seed
set.seed(1)
# make locOuts object
data = matrix(rnorm(2000), ncol = 4)
coords = matrix(rnorm(1000), ncol = 2)
groups = sample(1:10, 500, replace = TRUE)
lambda = 0.3
# local outlier detection
outs = local_outliers_ssMRCD(data = data,
coords = coords,
groups = groups,
lambda = lambda,
k = 10)
# plot results
plot(outs, type = "hist")
plot(outs, type = "spatial", colour = "outScore")
plot(outs, type = "3D", colour = "outScore", theta = 0)
plot(outs, type ="lines", focus = outs$outliers[1])
Run the code above in your browser using DataLab