Skip to contents

Installation

FrEDI is developed by an R package.

R

Install R and Rstudio, following the instructions for your operating system.

FrEDI

The FrEDI R package can be installed using the withr::with_libpaths() and devtools::install_github() functions.

If these packages are not installed, run:

install.packages('withr')
install.packages('devtools')

To install FrEDI for the first time:

withr::with_libpaths(  
    new = .libPaths()[1],  
    devtools::install_github(
        repo = "USEPA/FrEDI",  
        subdir = "FrEDI",  
        type = "source",  
        force = TRUE,  
        ref = "v4.1" # edit this to install a different branch of interest
        )
    )

library(FrEDI)

The user can specify a particular github branch, by including a ref. If not included, the default branch is main.
If the installation exists with the following error: Downloading GitHub repo USEPA/FrEDI@ref Error in utils::download.file(url, path, method = method, quiet = quiet, : cannot open URL 'https://api.github.com/repos/USEPA/FrEDI/tarball/ref' Make sure that both withr and devtools are up to date.

If prompted during installation, update all listed R packages (e.g., Enter 1).


Running FrEDI

Here we provide a simple example of the steps required to run FrEDI:

In RStudio, first load any user-defined temperature, population, or GDP input files. If your temperature file includes global temperatures, use FrEDI helper functions to convert to CONUS temperature.

tempInputFile <- file.path("your_file.csv")
inputs        <- import_inputs(tempfile = tempInputFile,  
                               temptype = "global")

Next, run FrEDI:

df_fredi_output <- run_fredi(inputsList= inputs)

For more examples, visit the Examples page.