View source: R/write_COSEROreg_par.r
adist_dels | R Documentation |
Calculate the approximate distance of two strings returning the matches, where deletions where necessary only.
adist_dels(x, y, dels = NULL, returnstrings = FALSE, warn = FALSE)
x |
string or vector of strings that the function will try to transform into y |
y |
string that the function uses to transform x into |
dels |
NULL or integer. If NULL (the default) set no limitations on how many deletions are allowed. If dels is an integer, allow only that many deletions as dels is set. |
returnstrings |
logical. Should the strings be returned (TRUE) or the positions within x. |
warn |
logical. Activate or deactivate warnings. |
This function calls adist
to calculate the approximate distance and the operations (insertions, substitutions and deletions) necessary to transform string x in string y. It then evaluates only the cases, where deletions where made only. The user may set a maximum of allowed deletions. If the transformation fails it throws a warning (if warn == TRUE) and return NA.
a string (vector) or a numerical (vector)
Simon Frey
y <- c("PCOR", "TCOR", "TMMON", "INTMAX", "ETVEGCOR", "DAYSDRY", "DAYSWET", "ETSYSCOR")
x <- "PCor1"
adist_dels(x,y, dels = 1, returnstrings = TRUE)
x <- "PCORXXX"
adist_dels(x,y, dels = 1)
adist_dels(x,y, dels = NULL)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.