RStudio Server from Windows Subsystem for Linux cannot find packages on PATH

404 Views Asked by At

I am trying to use RStudio Server to run a package (CNV-CLinViewer) through Windows Subsystem for Linux. All R packages required could be installed except for bedtoolsr, which requires bedtools (not an R package). I have bedtools installed on my WSL and the folder is part of my PATH.

For some reason, RStudio does not "see" it, however. I tried to manually set the path to bedtools using options(bedtools.path = "/home/usr/anaconda3/bin/bedtools"), but that did not help either.

Does anybody have a tip on how to make it visible to RStudio Server?

Thanks

1

There are 1 best solutions below

0
On

The issue was that the PATH variable was on RStudio was different from the one displayed on the terminal (it was missing /home/analyst/anaconda3/bin).

Editing the PATH variable on RStudio fixed it. I edited the variable like this: old_path <- Sys.getenv("PATH")

Sys.setenv(PATH = paste(old_path, "/home/analyst/anaconda3/bin", sep = ":"))