From hb at maths.lth.se  Wed Sep  3 10:08:48 2003
From: hb at maths.lth.se (hb@maths.lth.se)
Date: Wed Sep  3 09:08:22 2003
Subject: [Rd] Last line in .Rprofile must have newline (PR#4056)
Message-ID: <200309030708.h8378mJH017724@pubhealth.ku.dk>

Full_Name: Henrik Bengtsson
Version: R v1.7.1
OS: WinXP Pro, Solaris 9
Submission from: (NULL) (130.235.2.229)


A colleague of mine who is new to R had problems setting up his .Rprofile and we
tracked it down to the following. On both WinXP and Solaris with Rv1.7.1 we
noticed that the *last* line in .Rprofile has to have a *newline* to be
evaluated. For instance, starting R with the following .Rprofile:

 a <- 1 <newline>
 b <- 2

will only set the variable 'a'. Adding a newline to the second line will set 'b'
too. FYI: I browsed through ?.Rprofile and R-intro.html to see if it was
document, but it does not seem so. I also checked with the behavior of source()
too, but there a newline is not required. 

Best wishes

Henrik Bengtsson
Lund University

> str(R.Version())
List of 11
 $ platform: chr "sparc-sun-solaris2.9"
 $ arch    : chr "sparc"
 $ os      : chr "solaris2.9"
 $ system  : chr "sparc, solaris2.9"
 $ status  : chr ""
 $ major   : chr "1"
 $ minor   : chr "7.1"
 $ year    : chr "2003"
 $ month   : chr "06"
 $ day     : chr "16"
 $ language: chr "R"

> str(R.Version())
List of 11
 $ platform: chr "i386-pc-mingw32"
 $ arch    : chr "i386"
 $ os      : chr "mingw32"
 $ system  : chr "i386, mingw32"
 $ status  : chr ""
 $ major   : chr "1"
 $ minor   : chr "7.1"
 $ year    : chr "2003"
 $ month   : chr "06"
 $ day     : chr "16"
 $ language: chr "R"


[Rd] Last line in .Rprofile must have newline (PR#4056)
hb@maths.lth.se