## Load Microsoft Data Set -
x <- MSFT[1:12, ]
x
## Compute Differences -
diff(x)
## Trimmed Differences -
diff(x, trim = TRUE)
## Padded Differences -
diff(x, trim = FALSE, pad = 0)
Run the code above in your browser using DataLab