Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

diffPPM

difference in ppm between numeric values


Description

diff()-like function to return difference in ppm between psubsequent 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).

Usage

diffPPM(dat, toPrev = FALSE, silent = FALSE, callFrom = NULL)

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 message(s) produced

Value

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)

See Also

checkSimValueInSer and (from this package) .compareByDiff, diff

Examples

aa <- c(1000.01,1000.02,1000.05,1000.08,1000.09,1000.08)
.compareByPPM(list(aa,aa),30,TRUE)                    # tabular 'long' version
diffPPM(aa)

wrMisc

Analyze Experimental High-Throughput (Omics) Data

v1.5.4
GPL-3
Authors
Wolfgang Raffelsberger [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.