Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the folder from which the R session is started as the renv project folder #1712

Merged
merged 6 commits into from
Jun 20, 2024

Conversation

dklein-pik
Copy link
Contributor

Purpose of this PR

Fixing https://github.com/remindmodel/development_issues/issues/305

The .Rprofile always sets the renv project folder to the folder from which the R session is stared. Prerequisite: the folder needs to contain the .Rprofile.
Result: if started in a run folder, renv uses the renv-library from the run folder and not from the REMIND main folder.

cd /p/tmp/dklein/remind-renvtest/
Rscript -e "setwd('output/testOneRegi'); system('Rscript -e \"renv::project()\"')"
cd output/testOneRegi/
Rscript -e "renv::project()"

Both return [1] "/p/tmp/dklein/remind-renvtest/output/testOneRegi"

Type of change

  • Bug fix

Checklist:

  • My code follows the coding etiquette
  • I performed a self-review of my own code
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • I adjusted the reporting in remind2 where it was needed
  • I adjusted forbiddenColumnNames in readCheckScenarioConfig.R in case the PR leads to deprecated switches
  • All automated model tests pass (FAIL 0 in the output of make test)
  • The changelog CHANGELOG.md has been updated correctly

Further information (optional):

  • Test runs are here: /p/tmp/dklein/remind-renvtest/output/testOneRegi

…t (not always the main folder).

Change renv test back from warning into error.
@dklein-pik
Copy link
Contributor Author

The solution looks embarrassingly simple. But it was hard to figure what happens. Thank you Oli and Pascal, and sorry for the inconvenience.

.Rprofile Outdated Show resolved Hide resolved
scripts/start/run.R Show resolved Hide resolved
@orichters
Copy link
Contributor

Thanks for fixing it!

Copy link
Contributor

@orichters orichters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@dklein-pik dklein-pik merged commit 4adb45c into remindmodel:develop Jun 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants