# Randomly generate 10 values from a standard normal distribution
x <- rnorm(10)
# Calculate vector of proportion differences between subsequent values
y <- pdiffs(x)
# Calculate percent differences instead
z <- pdiffs(x, percent = TRUE)
# Compare results
x
y
z
Run the code above in your browser using DataLab