eval_lines: Evaluate each line of plain text file

View source: R/utils_helpers.R

eval_linesR Documentation

Evaluate each line of plain text file

Description

Reads a plain text file line by line, evaluating each line. Useful for creating variables dynamically, e.g. reading in parameters.

Usage

eval_lines(filepath)

Arguments

filepath

Filepath as a String.

Value

Nothing

Examples

## Not run: 
filepath <- tempfile()
writeLines(
  text = "LEFT = \"right\"",
  con = filepath
)
eval_lines(filepath)
print(LEFT)
unlink(filepath) # delete temporary file
rm(left) # remove example variable

## End(Not run)

MarkMc1089/FIC documentation built on April 3, 2022, 6:05 p.m.