Skip to contents

Reads a dictionary (a list of "key = value"-pairs) from a text file.

Usage

readDictionary(file, sorted = TRUE, fileEncoding = "", ...)

Arguments

file

full path to dictionary file or connection as e.g. opened with file

sorted

if TRUE (default) the entries in the dictionary will be sorted by their keys

fileEncoding

passed to readLinesWithEncoding

...

further arguments passed to readLinesWithEncoding

See also

Examples

file <- system.file("extdata", "dictionary.txt", package = "kwb.utils")

dictionary <- readDictionary(file)

resolve("file.out", dictionary, extension = "csv")
#> [1] "/root/example_project/out/example_file.csv"
resolve("file.out", dictionary, extension = "pdf")
#> [1] "/root/example_project/out/example_file.pdf"