I have a program called "bowtie2" and I changed the default path in terminal:
$export PATH=/opt/NGS/bowtie2-2.2.8:/usr/local/sbin:/usr/local/bin:/usr/sbin
$bowtie2 --version
/opt/NGS/bowtie2-2.2.8/bowtie2-align-s version 2.2.8
But when I call it from R it's still the old version from other path:
> bowtie2="bowtie2"
> system2(bowtie2,"--version",stdout=TRUE)[1]
[1] "/usr/bin/bowtie2-align version 2.1.0"
My question is how to change the default path for the program in R (so that the version is "/opt/NGS/bowtie2-2.2.8/bowtie2-align-s version 2.2.8" rather "/usr/bin/bowtie2-align version 2.1.0")