# NOT RUN {
library(healthcareai)
date <- seq.Date(from = as.Date('2016-01-03'), length.out = 52, by = 'week')
set.seed(34)
measureValue <- rnorm(length(date), mean = 100, sd = 15)
# Alter some measureValues to be at least 3 standard deviations from the mean
# so they can be displayed as violation examples.
measureValue[9] <- 179
measureValue[19] <- 22
measureValue[47] <- 177
d <- data.frame(date, measureValue)
nr1 <- nelsonRule1(df = d, measure_col = 'measureValue', date_col = 'date')
nr1
# }
Run the code above in your browser using DataLab