fix computation of R path -- ls -d equivalent