Reads a dictionary (a list of "key = value"-pairs) from a text file.
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
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"