Open baslat opened 1 month ago
I'm not a user of Positron. Does the ordinary ~/.Rprofile
startup script work? Please verify that first; if that doesn't work, then report that to the Positron issue tracker. Without it, startup cannot work.
Yes, the ordinary ~/.Rprofile
script works. If I set it to startup::startup(debug = TRUE)
it seems as though it's not finding the ~/.Rprofile.d
folder
# Positron
0.004s: startup::startup()-specific processing ...
0.004s: Found 'startup' directory '~/.Renviron.d'.
0.009s: - unloading the 'startup' package
# VSCode
0.005s: startup::startup()-specific processing ...
0.005s: Found 'startup' directory '~/.Renviron.d'.
0.007s: Found 'startup' directory '~/.Rprofile.d'.
0.013s: Processing 11 Rprofile files ...
That's all the output?
0.007s: Found 'startup' directory '~/.Rprofile.d'.
0.013s: Processing 11 Rprofile files ...
It clearly finds the folder and it identifies 11 files there-in.
You can also try to call
startup::startup(debug = TRUE
from the Positron prompt and see what you get. If you get an error, what does traceback()
report?
The VSCode output is an example of {startup} working as expected, in contrast to the output from Positron which doesn't seem to find the ~/.Rprofile.d
folder.
Manually running startup::startup(debug = TRUE)
in Positron doesn't throw an error, but doesn't load the expected behaviour, as it doesn't find the ~/.Rprofile.d
folder (same behaviour as when running on startup in Positron).
Here are the full logs from Positron
> startup::startup(debug = TRUE)
0.000s: System information:
0.001s: - R_HOME: '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources' (existing folder)
0.001s: - R call: ark --interactive --no-restore-data --quiet --no-site-file --no-init-file
0.001s: - Current directory: '/Users/bas'
0.001s: - User's home directory: '~' => '/Users/bas' (existing folder)
0.002s: - User's 'startup' config directory: '/Users/bas/Library/Preferences/org.R-project.R/R/startup' (non-existing directory)
0.002s: - Search path: '.GlobalEnv', 'tools:rstudio', 'tools:positron', 'package:stats', 'package:graphics', 'package:grDevices', 'package:utils', 'package:datasets', 'package:methods', 'Autoloads', 'package:base'
0.002s: - Loaded namespaces: 'compiler', 'startup', 'graphics', 'tools', 'utils', 'grDevices', 'stats', 'datasets', 'methods', 'base'
0.002s: The following has already been processed by R:
0.002s: - R_ENVIRON: ''
0.002s: - R_ENVIRON_USER: ''
0.003s: - '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/etc/Renviron' (23 lines; 1989 bytes) setting 23 environment variables ('R_PLATFORM', 'R_PAPERSIZE_USER', 'R_PAPERSIZE', 'R_PRINTCMD', 'R_RD4PDF', 'R_TEXI2DVICMD', 'R_GZIPCMD', 'R_UNZIPCMD', 'R_ZIPCMD', 'R_BZIPCMD', 'R_BROWSER', 'EDITOR', 'PAGER', 'R_PDFVIEWER', 'LN_S', 'MAKE', 'SED', 'TAR', 'R_STRIP_SHARED_LIB', 'R_STRIP_STATIC_LIB', 'R_LIBS_USER', 'R_LIBS_SITE', 'R_QPDF')
0.004s: - '.Renviron' (24 lines; 1344 bytes) setting 24 environment variables (**MY-ENV-VARS**)
0.004s: - tempdir(): '/var/folders/22/ln8pw35953b4hggsldkqb7mm0000gp/T//Rtmp5VqSue' (existing folder)
0.004s: - TMPDIR: ‘/var/folders/22/ln8pw35953b4hggsldkqb7mm0000gp/T/’
0.004s: - TMP: ‘’
0.004s: - TEMP: ‘’
0.004s: - R_LIBS: ''
0.004s: - R_LIBS_SITE: '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/site-library'
0.004s: - R_LIBS_USER: '/Users/bas/Library/R/arm64/4.4/library'
0.004s: - R_SCRIPT_DEFAULT_PACKAGES (only if Rscript was used): ''
0.005s: - R_DEFAULT_PACKAGES: '' (= 'base,methods,datasets,utils,grDevices,graphics,stats')
0.005s: - '/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/base/R/Rprofile' (160 code lines; 7953 bytes)
0.005s: - R_PROFILE: ''
0.005s: - R_PROFILE_USER: ''
0.005s: startup::startup()-specific processing ...
0.006s: Found 'startup' directory '~/.Renviron.d'.
0.010s: - unloading the 'startup' package
0.010s: - Search path: '.GlobalEnv', 'tools:rstudio', 'tools:positron', 'package:stats', 'package:graphics', 'package:grDevices', 'package:utils', 'package:datasets', 'package:methods', 'Autoloads', 'package:base'
0.010s: - Loaded namespaces: 'compiler', 'graphics', 'tools', 'utils', 'grDevices', 'stats', 'datasets', 'methods', 'base'
0.010s: startup::startup()-specific processing ... done
0.010s: The following will be processed next by R:
0.010s: - R_HISTFILE: ''
0.010s: - .First(): no such function on search()
0.011s: - Remaining packages per R_DEFAULT_PACKAGES to be attached by base::.First.sys() (in order):
0.011s: - The R just-in-time (JIT) compiler:
0.011s: - R_ENABLE_JIT: <not set>
0.011s: - JIT compiler enabled by default
0.011s: The following will be processed when R terminates:
0.011s: - .Last(): no such function on search()
0.011s: - .Last.sys(): no such function on search()
I think I've identified the reason, and it has to do with Positron launching R using:
ark --interactive --no-restore-data --quiet --no-site-file --no-init-file
Specifically, startup::startup()
sees --no-site-file
and --no-init-file
and interpret those as the Rprofile scripts should not be processed. I don't understand why they use those command-line options, but maybe there's a good reason. Until that is better understood, you can update your ~/.Rprofile
script to use:
startup::startup(skip = FALSE)
That tells startup()
to ignore any --no-site-file
and --no-init-file
options.
I'll try that out. I also updated to the dev version of {startup} asI saw you made some commits and get this error:
.Rprofile error: could not find function "is_ark"
.Rprofile error: could not find function "is_ark"
Oops - forgot to add some new files to repo.
Nice, things seem to be working now, thanks!
The startup package doesn't seem to work with position. I use {startup} with VSC all the time without issue, however it doesn't work in positron (not even if I trigger it manually with
startup::startup()
). I wonder if this could be related to ark?