I\'m trying to "translate" this Python code to R:
# create a differenced series def difference(dataset, interval=1): diff = list() for i in