# NOT RUN {
# Create dataset
X <- iris[,1:4]
# Find outliers by setting an optional k
outlier_score <- KNN_IN(dataset=X, k=10)
# Sort and find index for most outlying observations
names(outlier_score) <- 1:nrow(X)
sort(outlier_score, decreasing = FALSE)
# Inspect the distribution of outlier scores
hist(outlier_score)
# }
Run the code above in your browser using DataLab