read_mapping: Read Mapping

read_mappingR Documentation

Read Mapping

Description

Read mapping table.

Usage

read_mapping(
  file,
  mode = "table",
  sep = ";",
  self.match = FALSE,
  include.lowercase = FALSE,
  ignore.empty = FALSE,
  sort = FALSE,
  verbose = FALSE,
  remove.ambiguous = TRUE,
  lowercase.only = FALSE,
  from = "synonyme",
  to = "name",
  fast = FALSE,
  encoding = "UTF-8",
  trim = FALSE,
  empty.is.na = FALSE
)

Arguments

file

Input file

mode

The input file type: "list", "vector" or "table"; see details.

sep

Separator mark.

self.match

Include self matches

include.lowercase

Include lowercase

ignore.empty

Ignore the empty cases

sort

Sort synonymes

verbose

verbose

remove.ambiguous

Remove ambiguous terms.

lowercase.only

All synonymes considered in lowercase only

from

field that will be replaced

to

field that contains the final names

fast

Use the fast method fread (sensitive to problems in table format)

encoding

Character encoding (needed in Windows environment)

trim

trim empty spaces from the beginning and end of the strings

empty.is.na

Interpret empty conversions as NA. By default this is FALSE.

Details

If mode = "list", each row of the input file corresponds to a unique entry with potentially multiple name variants, separated by semicolon. The first element gives the selected version of the name, the subsequent elements list synonymes that will be mapped to the selected version. If mode = "table", the file has two columns where each row corresponds to a unique entry and has the selected name and a single alternative name.

Value

Synonyme data frame with the fields 'name' (the selected term) and 'synonyme' (the alternative terms).

Author(s)

Leo Lahti leo.lahti@iki.fi

References

See citation("bibliographica")

Examples

## Not run: syn <- read_mapping(file)

rOpenGov/bibliographica documentation built on April 10, 2022, 8:51 p.m.