This workflow prepares the R dependencies for PsN by installing PsNR
along with all of the dependencies required. It uses renv.lock
to restore most of the dependencies, and the pacakge cellar for PsNR
and vaplot
pacakges.
The 2 cellar packages are built with slight tweaks to enable a local workflow. 1. The original PsNR
requires vaplot
to come from Remotes: rikardn/vaplot@digits
, we don't want to rely on a GitHub branch so we removed the remote source. 2. vaplot
was built fresh from the digits branch as a local tarball. This way we can use it as a cellar pacakge without having to install from GitHub every time we set up the environment.
rlibs_r43_jammy.tar.xz
contains all the R libraries needed (all from ~/your-project/renv/library/R-4.3/x86_64-pc-linux-gnu
) to run library(PsNR)
.
-
Start an RStudio project and make sure you have
renv
activated. This workflow was tested onrenv
1.0.3. -
Clone this repo in a terminal.
git clone https://github.com/A2-ai/misc-assets
-
Copy the .Rprofile from
misc-assets
to your project root so it replaces the existing file. This ensures the packages we are going to install to not use cache or symlinks, so we can copy them later on.cp ./misc-assets/.Rprofile .
Move the folder
cellar
as a subfolder ofrenv
in your project, sorenv
detects it when installing the 2 packages.mv ./misc-assets/cellar/ ./renv/
-
Install all the packages in the R console.
renv::restore()
-
Check whether PsNR loads correctly in R.
library(PsNR)
-
Copy
copy_rlibs.sh
to project root and run it.cp ./misc-assets/copy_rlibs.sh . && bash copy_rlibs.sh
-
We should see 124 folders in
/opt/PsN/5.3.1/PsN_5_3_1/rlibs
ls /opt/PsN/5.3.1/PsN_5_3_1/rlibs | wc -l