REditorSupport / REditorSupport/vscode-R

code chunks in .Rmd file appear to use computer directory for libraries and not renv project folder

Open
#1,372 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug stale
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Describe the bug
Hello, sorry if I do not provide any reprex but I am not sure how to do so for my specific problem.

I was wondering why running code chunks in my .Rmd file results in errors telling that x package is not installed, when I have it installed in the .renv folder of my main project folder. Is there a way to specify the path somewhere so that any code chunks in the .Rmd file look for packages in .renv and not in my computer folders?

When I installed the package outside of my folder, running the code chunk worked, so I believe that it is looking for libraries outside of the project folder

Environment:

  • OS: Windows 11 Pro
  • VSCode Version: 1.78.2
  • R Version: 4.1.3
  • vscode-R version: 2.8.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows 11 with VS Code, vscode-R 2.8.0, R 4.1.3, an .Rmd file, and a project using renv. Check how code chunks choose their R library paths and compare execution inside and outside the project. Done means chunks consistently find packages from the project’s renv environment without requiring a computer-wide installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, vscode
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.