Learn R Programming

wrMisc (version 1.15.3.1)

checkSimValueInSer: Check for similar values in series

Description

This function checks all values of 'x' for similar neighbour values within (relative) range of 'ppm' (ie parts per milion as measure of distance). By default values will be sorted internally, so if a given value of x has anywhere in x another value close enough, this will be detected. However, if sortX=FALSE only the values next to left and right will be considered. Return logical vector : FALSE for each entry of 'x' if value inside of ppm range to neighbour (of sorted values)

Usage

checkSimValueInSer(
  x,
  ppm = 5,
  sortX = TRUE,
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Value

This function returns a logical vector : TRUE for each entry of x where at least one neighbour is inside of ppm distance/range

Arguments

x

numeric vector

ppm

(numeric, length=1) ppm-range for considering as similar

sortX

(logical) allows speeding up function when set to FALSE, for large data that are already sorted

silent

(logical) suppress messages

debug

(logical) additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

See Also

similar with more options withinRefRange

Examples

Run this code
va1 <- c(4:7,7,7,7,7,8:10)+(1:11)/28600; checkSimValueInSer(va1)
data.frame(va=sort(va1),simil=checkSimValueInSer(va1))

Run the code above in your browser using DataLab