This is a diff()-like function to return difference in ppm between subsequent values.
Result is oriented, ie neg ppm value means decrease (from higher to lower value). Note that if the absolute difference remains the same the difference in ppm will not remain same.
Any difference to NA is returned as NA, thus a single NA will result in two NAs in output (unless NA is 1st or last).
This function returns a list with close matches of 'x' to given 'y', the numeric value dependes on 'sortMatch' (if FALSE then always value of 'y' otherwise of longest of x&y)
Arguments
dat
(numeric) vector for calculating difference to preceeding/following value in ppm
toPrev
(logical) determine oriention
silent
(logical) suppress messages
callFrom
(character) allows easier tracking of messages produced
See Also
checkSimValueInSer and (from this package) .compareByDiff, diff