This function reads environment variables from a specified .env
file and
assigns them to variables in the R environment based on a data frame
containing variable names, values, and checks for directories and files. It
is designed to facilitate the management of environment variables in a
structured and reproducible manner.
Arguments
- EnvFile
Character string specifying the path to the
.env
file. Default is ".env". This file should contain environment variables in the formatVAR_NAME=value
.- EnvVarDT
A data frame or tibble containing the columns
VarName
,Value
,CheckDir
, andCheckFile
. Each row specifies an environment variable, the name to assign it to, and whether to check if it is a directory or file. This structure allows for additional validation checks on the variables being imported.