checkSimValueInSer: Check for similar values in series

View source: R/checkSimValueInSer.R

checkSimValueInSerR Documentation

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
)

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

Value

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

See Also

similar with more options withinRefRange

Examples

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

wrMisc documentation built on Nov. 17, 2023, 5:09 p.m.