question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sourcing an arbitrary script before running R/radian

See original GitHub issue

Is your feature request related to a problem? Please describe. On cluster-like machines, we usually don’t have a default R installation on the PATH on startup. Instead, we activate modules that load the desired versions of anything for each project before starting. So, if for example I wanted to use R 3.4.4 with the curl library 7.58 a common workflow is to source a project-specific shell script, for example load_R.sh here:

#!/bin/bash
# load_R.sh contents
module load curl/7.58
module load R/3.4.4

and then proceed to start R or run Rscript. A similar case applies to e.g. conda environments in more common settings.

Apparently options such as r.rterm.linux do some kind of check of whether it points to a “default” R wrapper script or something. So just prepending a source load_R.sh leads to a "Cannot find R client at " error.

Describe the solution you’d like I believe a good, simple solution would be to create an option e.g. r.rterm.sourcescript.linux with a path to a shell file to be sourced before the R extension calls anything. This would allow a lot more fine tuning of the environment exclusively for the extension.

Describe alternatives you’ve considered Although sourcing the script on .profile or the like can be a workaround (although I was never able to make it work), it’s very messy since we don’t always want to source the same things in an R IDE-like setting, an interactive shell and a submission script.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
gabriel-abrahaocommented, Apr 15, 2021

I did. What ended up fixing the issue, and actually solves the problem here in the first place, was this issue on vscode-remote-release.

The trick is to add an argument to the shell initialization via terminal.integrated.shellArgs.linux which runs an arbitrary command string that ends by invoking the shell again. So if anyone runs into this, just add whatever initialization stuff you need in place of source $HOME/load_R.sh here.


    "terminal.integrated.shellArgs.linux": [
        "-c",
        "source $HOME/load_R.sh ; exec $SHELL -l"
    ]


0reactions
github-actions[bot]commented, Aug 20, 2022

This issue was closed because it has been inactive for 14 days since being marked as stale.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sourcing a python script in Rstudio - Stack Overflow
So I can run my python script eq_odds.py (which takes a file as input) in my terminal as follows: eq_odds.py data/health.csv.
Read more >
bc Command Manual - GNU.org
bc is a language that supports arbitrary precision numbers with interactive execution of statements. There are some similarities in the syntax to the...
Read more >
1. HIL API — Typhoon API 2022.4 documentation
Arbitrary waveform data will be sent to a HIL device, but will not be activated. ... None), you need to wait for the...
Read more >
ANSYS Mechanical APDL Command Reference - BME-MM
The Command Reference is intended to give you information on individual ANSYS ... Run - The collection of all ANSYS commands between the...
Read more >
The Spike2 script language - Cambridge Electronic Design
Spike2 runs your script in much the same way as you would read it. ... You will find that the rest of this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found