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
1
vote
1 answer

Alias function name in .Rprofile so that it is used by all R Scripts

I am currently trying to alias the R function png with CairoPNG to generate png files. I am coming from a sys admin perspective on R - meaning I did not write any of the R code, and I am not in a position to change any of the R code. I am running it…
d_kennetz
  • 5,219
  • 5
  • 21
  • 44
1
vote
1 answer

Content of the .First function does not appear to be processed when running in RStudio

In my .Rprofile I've defined the following .First function that has two purposes: Show available library paths Change the settings of colorout package if running RStudio with a bright theme .First <- function() { if (interactive()) { …
Konrad
  • 17,740
  • 16
  • 106
  • 167
1
vote
1 answer

Encoding issue in .Rprofile at the startup of R

I use R (v3.5.1) on Windows 10. And there is a .Rprofile file in my working directory. The file contains non-ASCII letters but is saved with UTF-8 encoding. At the startup, the encoding of non-ASCII letters is distorted. For example the code: nth <-…
GegznaV
  • 4,938
  • 4
  • 23
  • 43
1
vote
1 answer

Building an R package error with devtools::document

I am building R packages using devtools. I've built a package with some functions that I'd like to include. And I'd like to load the package and its documentation at startup. My package files are located at the location: '~/global/Rcode/Startup…
1
vote
2 answers

Where else can .Last hide? I deleted .Rprofile and .Last still runs

I used to have a dbConnect statement as .First in my .Rprofile and a dbDisconnect statement as .Last. I no longer need these, so I removed them from .Rprofile, but R hangs when I exit because of the dbDisconnect statement. I can quit with…
Richard Herron
  • 9,760
  • 12
  • 69
  • 116
1
vote
2 answers

How to store API key in .Rprofile?

I received a token to access the IUCN redlist portal in R through an API. From InsideR, I read the following: "iucn_summary uses the new Redlist API for searching for a IUCN ID, so we use the rl_search function internally. This function requires an…
Niels Raes
  • 51
  • 1
  • 7
1
vote
1 answer

R: Rprofile updated when new R version installed

When I installed a new version of R, my customised.Rprofile is not loaded. The R GUI starts using the new version and its corresponding .Rprofile. Is there a way to still using the customised regardless of any update in the R version? A follow up…
donpresente
  • 1,230
  • 2
  • 13
  • 24
1
vote
1 answer

Mask a function from `ls` in R

I want to put the following function in my .Rprofile to make installation of bioconductor packages easier: install.bioconductor <- function(...) { source("http://bioconductor.org/biocLite.R") biocLite(...) } But when I load a new R session,…
Scott Ritchie
  • 10,293
  • 3
  • 28
  • 64
1
vote
1 answer

R fails to start after moving Rprofile

I'm using R on a Mac. I tried moving my Rprofile file to a different location, but R didnt start. When I tried to put the Rprofile file back into its original location, I couldn't remember which folder exactly it came from. My Rprofile file was…
luciano
  • 13,158
  • 36
  • 90
  • 130
1
vote
1 answer

Rprofile.site can't work

my system :debian in console: nano /home/tiger/R-2.15.1/etc/Rprofile.site here is my content: .First <- function(){ cat("\nWelcome at", date(), "\n") } .Last <- function(){ cat("\nGoodbye at ", date(), "\n") } when i save…
Peng Peng
  • 1,305
  • 3
  • 16
  • 20
0
votes
1 answer

Databricks: configure R to use custom CRAN mirror by default

I want to specify a default custom CRAN mirror in R under Databricks, but adjusting the config in the Rprofile.site file seems not to bet recognized at all. I have already read the official Microsoft documentation on how to customize the R session…
0
votes
0 answers

How to remove 'renv' folder? Cannot access project so cannot use renv::deactivate

I'm trying to remove the 'renv' folder from my project, in order to remove renv from the project. Note: I cannot access the project on the server that I'm on, so trying to do this from file explorer. I have managed to remove the renv.lock…
lilblue
  • 84
  • 7
0
votes
0 answers

How can i establish a connection to a db no using credentials every time

I'm working with several R files that need connect to database but server has timeout so timeout=inf is not functional What i was looking for is something like this: RMySQL Database connection (I'm the only user in R, and in total users just a…
hfa
  • 39
  • 5
0
votes
0 answers

install.packages() from .Rprofile cannot find function "install.packages"

my testing .Rprofile: message("~/.Rprofile starting") options(repos="https://cran.microsoft.com/") if (!require("data.table")) install.packages("data.table") message("~/.Rprofile ending") works if I start with R --vanilla and then…
ivo Welch
  • 2,427
  • 2
  • 23
  • 31
0
votes
1 answer

Installing additional packages through Rprofile

I want to install additional packages besides the default ones every time I restart my R Session. I have tried this: options(HTTPUserAgent = sprintf("R/%s R (%s)", getRversion(), paste(getRversion(), R.version$platform, R.version$arch,…
A. MATULA
  • 31
  • 1
  • 7