I tested Quarto this morning on Windows with various shells and stumbled again on an old issue regarding using R in terminal on Windows. This caused me pain with Quarto not finding the R packages depending on where it is used. Best thing would be to show you but in short: R user's lib path is not the same depending on the shell used ! It seems crazy but I think it relies on the HOME folder not being the same either. 

With an R Session on RStudio and cmd, lib path will be inside `Documents`
```r
> Sys.getenv("R_LIBS_USER")
[1] "C:\\Users\\chris\\Documents/R/win-library/4.1"
> path.expand('~')
[1] "C:\\Users\\chris\\Documents"
```
but with Powershell or minGW, user lib path will be elsewhere, inside user directory.
```r
> Sys.getenv("R_LIBS_USER")
[1] "C:\\Users\\chris/R/win-library/4.1"
> path.expand('~')
[1] "C:\\Users\\chris"
```

As I am an R users using mainly RStudio, my packages are installed in `C:\\Users\\chris\\Documents/R/win-library/4.1`. This causes Quarto to no find out R packages on Powershell and MinGW (`quarto env` results). It would require maintaining two user libraries to render the same no matter which tool is used.

This is an issue I already encountered when using Makefile with R. This home directory behavior is painful on Windows. 


I am not sure which is the best solution, but I think this will clearly creates pain for users trying to use Quarto and R outside of RStudio. (Using Powershell or MinGW inside RStudio Terminal does not have this issue). 

I opened this issue as notes for our discussions. Maybe one of you encountered that already
2021-06-14T10:46:15Z
cderv
closed
Quarto and R packages on Windows: different user lib depending on shell used
https://github.com/quarto-dev/quarto-cli/issues/37