Questions tagged [rprofile]

The R statistical package uses both or either Rprofile.site or .Rprofile to load startup requirements.

The R statistical package uses both or either Rprofile.site or .Rprofile to load startup requirements. .Rprofile instances may be multiple and can be directory/project specific.

62 questions
2
votes
0 answers

.Rprofile's search path is not the same as the default one

Consider the two lines below: Sys.setenv(R_IMPORT_PATH = "/path/to/my/r_import") foo <- modules::import("foo") If I execute this code from within an already-established interactive R session, it works fine. But if I put the same two lines in my…
kjo
  • 33,683
  • 52
  • 148
  • 265
2
votes
1 answer

Update Package Automatically at Start-up

I find it annoying that I have to click Tools -> Update Packages every time I load RStudio. I could use update.packages(c("ggplot2")) for instance to update my packages in .RProfile, but the issue is that it won't look for other packages…
watchtower
  • 4,140
  • 14
  • 50
  • 92
2
votes
2 answers

R Install.packages fails with "object not found error"

I am currently trying to install packages on R. On the startup, I get the normal R message with "Error: object 'getw' not found" When I use the install.packages function, I get the same error at the end of the installation, one for each package I…
drezap
  • 83
  • 1
  • 1
  • 8
2
votes
1 answer

Setting `width` in Rprofile

Relevant: Dynamic column resizing in .Rprofile If I attempt to pass Sys.getenv("COLUMNS") as an integer (or as numeric or as is, i.e., as a string) to the parameter width of options() in my user .Rprofile, I get an error upon startup: Error in…
user109114
  • 403
  • 4
  • 10
2
votes
0 answers

How to assign options("browser") at startup without being modified by RStudio?

Consider this in ~/.Rprofile or path/to/project/.Rprofile: .First <- function () { options(browser="firefox") cat("Browser:", getOptions("browser"), "\n") } (Re)Starting R within RStudio prints at the console at least the following: Browser:…
setempler
  • 1,681
  • 12
  • 20
2
votes
2 answers

Startup script in Rprofile throws 'function not found' errors

I want R to load a certain file on initialization, so naturally I added a source command to my Rprofile so: .First <- function() { cat("\n Welcome to R MotherFnorder!!!\n\n") setwd("/home/username/Code/R/") …
Ixxie
  • 1,393
  • 1
  • 9
  • 17
2
votes
1 answer

How to set the color palette in the .Rprofile

I'd like to change the Color palette on startup of R. Thus I copied the following source-code to my .Rprofile palette(c( "#2e3436" # (Aluminium 6) , "#ef2929" # (Scarlet Red 1) , "#73d216" # (Chameleon 2) , "#3465a4" # (Sky Blue 2) ,…
R_User
  • 10,682
  • 25
  • 79
  • 120
2
votes
1 answer

For loop in .Rprofile calls itself recursively?

I have multiple versions of R installed (2.15 and 3.0.1), which I often switch between. I want to make sure that when I install a package in one version, it will also be present in the other (where possible), so I have attempted to set up the…
Scott Ritchie
  • 10,293
  • 3
  • 28
  • 64
1
vote
1 answer

rprofile running multiple times

My .Rprofile always runs twice. I looked at this thread and think it might be because the slashes are going in various directions. I only have code in the paths pointing at C:/Users/rileyj3/.Rprofile (results 1, 2 & 4). Does anyone know how to…
yake84
  • 3,004
  • 2
  • 19
  • 35
1
vote
0 answers

Rprofile and worksplace

I'm using macOS and I have a Rstudio, I always use my personal folder to work with R in Rstudio, I set the default working directory by Rstudio -> Preference -> General -> R Session and add ~/R as the Default working directory. Then I created a…
abraham
  • 661
  • 8
  • 14
1
vote
1 answer

How to load .Rprofile and .Renviron files from an existing R project in JupyterLab?

I currently have an R project that I created in Rstudio. For this project I created an .Rprofile file. Lately, I've been using JupyterLab to test things, and while I set the same working directory (setwd("~/path/to/project")) as the same as the…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
1
vote
0 answers

large number of packages attached in a fresh R session

[Env: Windows 7, R version 3.6.3] Something has happened to my R GUI installation, such that when I launch R from the desktop icon, a large number of packages are automatically loaded by a namespace (not attached). Why this is a problem: When I try…
user101089
  • 3,756
  • 1
  • 26
  • 53
1
vote
1 answer

How to get a path string from R that I can paste immediately into Windows

Let's say I have a Windows path: "R:\data\state-capitals\final\" If I add "\", I can use the path inside the R console (on a Windows system). mypath = "R:\\data\\state-capitals\\final\\"; If I have the R console form mypath =…
mshaffer
  • 959
  • 1
  • 9
  • 19
1
vote
2 answers

customise R help files - font colouring

I'm wondering is it possible to customise R help files so that certain text is colour coded and easier to read. rdoc already does this except that it sends the output to the console. I would instead, like it to be sent to the help panel (i'm using…
user63230
  • 4,095
  • 21
  • 43
1
vote
1 answer

How to overwrite reprex uploading to imgur for all users

I manage a R programming environment for a group of users at my company. We often work with sensitive data, and some of my data scientists have started using the reprex package in R. It's a great little package, but I noticed the package by default…
drizzle123
  • 517
  • 5
  • 18