Setup

First, install the keras R package

install.packages("keras")

If you do not have a python installation on your machine, run the following. You can also specify a version (>3.0) that you’d like to use, or let reticulate find one for you using python = virtualenv_starter(version)

library(reticulate)
virtualenv_create("r-reticulate", python=install_python())

Then, install keras (the python version) into the virtual environment you just made.

library(keras)
install_keras(envname = "r-reticulate")

Restart R, then make sure things worked

packageVersion("keras")
[1] '2.16.1'
packageVersion("tensorflow")
[1] '2.20.0'

Finally, install the psptools package straight from Github

remotes::install_github("BigelowLab/psptools")