[R] .Rprofile: "contains invalid line(s)"

Ista Zahn istazahn at gmail.com
Thu Jun 5 19:58:39 CEST 2014

Hi Stephan,

R_ENVIRON should not point to your .Rpofile, use R_PROFILE_USER for
that. See ?Startup for details.


On Thu, Jun 5, 2014 at 10:18 AM, Stephen Davies <stephen at umw.edu> wrote:
>     At some point in the recent past, my local .Rprofile has ceased to be
> executed on startup. I've upgraded R several times in the last few months, and
> am unsure which version caused this problem. Currently I'm running version
> 3.1.0 (2014-04-10) "Spring Dance" on 64-bit Ubuntu.
>     My symptoms and fix attempts:
>     1) Changes I make to .Rprofile are no longer automatically recognized by R
> on startup.
>     2) After some Googling, I was led to believe that I need to set the
> environment variable R_ENVIRON to "/home/stephen/.Rprofile." But after doing
> so, when I start R, I get an error message: "File /home/stephen/.Rprofile
> contains invalid line(s)". Then it lists the contents of .Rprofile, which are
> now simply:
> .First <- function() {
>     joe <<- function(x) x*2
> }
>     This file is perfectly valid, however, which I know because when I
> explicitly source() it, it loads .First just fine, and if I run ".First()", I
> can then successfully run "joe(3)".
>     Why does R say this .Rprofile is invalid on startup? Is setting R_ENVIRON,
> as described, the correct procedure? And why did this suddenly become
> necessary?
> - Stephen Davies, Ph.D.
>   (stephen at umw.edu)
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list