MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #15940] Rprofile file not read under MAC OS 10.9.4 #5423

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

i,

I've installed R in a math computer classroom and need a method to automatically load additional packages beyond the default packages:

  1. The package manager does not remember checked packages to load between sessions.

  2. Also, R does not seem to read the .Rprofile file located in a user's home directory when R starts. Thus, R does not read and execute a .First function.

  3. I've also tried to use an Rprofile.site file in the subdirectory etc but that does not seem to be read either!

In short their does not seem to be a way to change the default packages that are loaded when R starts under Mac OS 10.9.4.

Regards,

Adam Hausknecht Department of Mathematics UMass Dartmouth


METADATA

MichaelChirico commented 4 years ago

This works for me. Looks like at least your analysis is wrong; .Rprofile is read and run.

R version 3.1.1 (2014-07-10) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin13.1.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

[1] "Hi!" [R.app GUI 1.65 (6784) x86_64-apple-darwin13.1.0]

system("cat ~/.Rprofile")

print("Hi!")


METADATA

MichaelChirico commented 4 years ago

(In reply to Peter Dalgaard from comment #1)

This works for me. Looks like at least your analysis is wrong; .Rprofile
_is_ read and run. 

R version 3.1.1 (2014-07-10) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin13.1.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

[1] "Hi!"
[R.app GUI 1.65 (6784) x86_64-apple-darwin13.1.0]

> system("cat ~/.Rprofile")
print("Hi!")
>

Dear Peter Dagaard,

Thanks for your quick response!

Here is the output from my MacBook Pro running Mac OS 10.9.4:

----------------------------------------------------------------------------------- R version 3.1.1 (2014-07-10) -- "Sock it to Me" Copyright (C) 2014 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin13.1.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

Natural language support but running in an English locale

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

[R.app GUI 1.65 (6784) x86_64-apple-darwin13.1.0]

[Workspace restored from /Users/ahausknecht/.RData] [History restored from /Users/ahausknecht/.Rapp.history]

system("cat ~/.Rprofile")

print("Hi")

---------------------------------------------------------------------------------------

As you can see the line

[1] Hi!

is missing. But the Rprofile file containing the print statement is present in my home directory!

I'm not sure what to do to fix the problem! Perhaps there is some R environment variable that is missing or is not set correctly.

Regards,

Adam Hausknecht Department of Mathematics UMass Dartmouth


METADATA

MichaelChirico commented 4 years ago

Please check your preferences - R.app allows you to override the startup directory which would also override the location of .Rprofile. If it doubt, you can reset your preferences to the default settings by renaming or deleting Library/Preferences/org.R-project.R.plist


METADATA

MichaelChirico commented 4 years ago

Hm, the workspace does seem to be restored from∼/.RData so presumably the Startup dir isn't changed?

Also check the environment. Having R_PROFILE set might explain it. (No idea how that would happen, but something clearly isn't normal.)


METADATA