I wrote the following function to remove the trend and seasonality of a dataset
# Create a differenced series difference <- function(dataset, interval=1) {