msp: Fix misspelling and different in similar character data.

Description Usage Arguments Details Value Examples

View source: R/msp.R

Description

Look for similatiries between a caharacter and a vector character to detect misspeling problems and change it.

Usage

1
msp(x, y, r = 0.8, type = "ask", ...)

Arguments

x

a character to search

y

the vector containing x and order character

r

level of similarity between element, by default is 0.8

type

an charactaer indicating the remplacement procudure. Se details for mor information

...

additional arguments are passed on to stringsim function.

Details

Type define the way of the rigth option to replace is choose, |codeask generate a interactive replacement process, first use the fisrt element of the list as correct element to repalce and min use the smallest element as correct to replace. The default value is ask

Value

a same object than x without misspelling

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
	set.seed(1)
	z <- stringi::stri_rand_strings(20, 5)
	a <- z[1]
	a1 <- c("GNZuC","GNZuC ", "GNZu.C"," GNZuC", "GNZ uC", "gNZuC")
	z <- c(z,sample(z),sample(z,10),a1)
	msp(a,z)

## End(Not run)

amvallone/msp documentation built on May 16, 2019, 6:56 p.m.