site_names_correction: Homogenises site names The function takes a strings of...

Description Usage Arguments Details Value Author(s) Examples

View source: R/site_names_correction.R

Description

Homogenises site names The function takes a strings of heterogeneous site names, corrects misprints and homogenises spacing, capital letters and names.

Usage

1
2
3
4
5
6
site_names_correction(
  site_vector = NA,
  add_site_category_to_acronyms = FALSE,
  site_category = "Site",
  convert_to_ascii = FALSE
)

Arguments

site_vector

a character vector containing site names to correct

add_site_category_to_acronyms

Should a common name specified in site_category should be added to sites only described by an acronym. Default to FALSE.

site_category

Word added to accronyms if add_site_category_to_acronyms = TRUE.

convert_to_ascii

Change the encoding of the vector to ASCII which replaces all special characters to their closest ASCII equivalent: accentuated characters such as Áêãçoàúü are converted to their basic equivalent Aeacoauu

Details

details

Value

A character vector of same length as site_vector

Author(s)

Alban Sagouis

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
extend_genus_names(c("Bufo bufo", "B. bufo", "Buteo buteo", "B. buteo"))
exmpl <- c('s2','1','site.3','forestPrime','forest,border','forest border','(border)')
data.frame(exmpl,
           corrected = site_names_correction(site_vector = exmpl,
                      add_site_category_to_acronyms = TRUE)
)
         exmpl     corrected
1            s2       Site s2
2             1        Site 1
3        site.3        Site.3
4   forestPrime  Forest Prime
5 forest,border Forest,border
6 forest border Forest border
7      (border)      (border)

AlbanSagouis/iClean documentation built on May 14, 2020, 9:06 p.m.