read-dotenv-files

This repository contains small scripts as well as instructions to read .env files in several languages.

View the Project on GitHub Baelfire18/read-dotenv-files

R Dotenv

For using it in R first you have to have:

  1. A R version installed.

  2. Optionally having a R Studio.

For a .env file like this:

# Install package if not installed yet
if (!require("dotenv")) install.packages("dotenv")
require("dotenv")

load_dot_env(".env")

DB_NAME <- Sys.getenv("DB_NAME")
print(DB_NAME)