eval_lines: Evaluate each line of plain text file

Description Usage Arguments Value Examples

View source: R/utils_helpers.R

Description

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

Usage

1
eval_lines(filepath)

Arguments

filepath

Filepath as a String.

Value

Nothing

Examples

1
2
3
4
5
6
7
8
9
filepath <- tempfile()
writeLines(
  text = "LEFT = \"right\"",
  con = filepath
)
eval_lines(filepath)
print(LEFT)
unlink(filepath) # delete temporary file
rm(left) # remove example variable

MarkMc1089/mongo2shiny documentation built on Dec. 17, 2021, 3:13 a.m.