[R] Setting .Rprofile for RStudio on a Windows 7 x64bit

56 views
Skip to first unread message

BR_email

unread,
Apr 15, 2017, 12:06:57 PM4/15/17
to r-h...@r-project.org
Hi R-helpers:
Can you offer assistance in my getting .Rprofile and .Rprofile.site to
run in RStudio?
When I start RStudio nothing happens.
I have put .Rprofile in [1] and [2], and .Rprofile.site in [2].

Below, the info I believe you need to know.
Thanks, in advance, for any help.
Bruce

The .Rprofile and .Rprofile.site are R-type files, which contain the two
lines below.
Also, I tried the profile files as text files.
options(prompt="R> ")
set.seed(12345)

>Sys.getenv("HOME") [1] "C:/Users/BruceRatner/Documents"
>Sys.getenv("R_HOME") [2] "C:/PROGRA~1/R/R-33~1.3"


--

______________________________________________
R-h...@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

William Dunlap via R-help

unread,
Apr 15, 2017, 2:45:02 PM4/15/17
to BR_email, r-h...@r-project.org
I think the site-specific R profile should be, using R syntax
file.path(R.home("etc"), "Rprofile.site") # no dot before the capital R
The personal R profile will be
file.path(Sys.getenv("HOME"), ".Rprofile") # there is a dot before capital R
but if a local R profile,
file.path(getwd(), ".Rprofile") # there is a dot before capital R
exists it will be used and the one in HOME will not be. (getwd() should
be the startup directory.)


Bill Dunlap
TIBCO Software
wdunlap tibco.com

BR_email

unread,
Apr 15, 2017, 3:15:14 PM4/15/17
to William Dunlap, r-h...@r-project.org
Bill:
Thanks for reply.
Sorry, I do not understand it.
For example, where do I put "file.path(getwd(), ".Rprofile")" ?

Bruce

David Winsemius

unread,
Apr 15, 2017, 3:34:30 PM4/15/17
to BR_email, r-h...@r-project.org

> On Apr 15, 2017, at 12:14 PM, BR_email <b...@dmstat1.com> wrote:
>
> Bill:
> Thanks for reply.
> Sorry, I do not understand it.
> For example, where do I put "file.path(getwd(), ".Rprofile")" ?

This is not the correct venue for questions about RStudio setup. Instead this questions should go to:

https://support.rstudio.com/hc/en-us

--
David.
David Winsemius
Alameda, CA, USA

Boris Steipe

unread,
Apr 15, 2017, 3:46:55 PM4/15/17
to BR_email, r-h...@r-project.org
As with R, do with RStudio: Read The Beautiful Manual, and peruse The Google. For example, searching Google with the two (admittedly hard to guess) cryptograms:
"RStudio Rprofile"

will present more than a dozen most enlightening links to fulfil your desire.

Perhaps the following link works better for you though:
https://www.bing.com/search?q=rstudio+rprofile

B.

BR_email

unread,
Apr 15, 2017, 3:52:42 PM4/15/17
to David Winsemius, r-h...@r-project.org
David:
Thank you.
Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

David Winsemius wrote:
>> On Apr 15, 2017, at 12:14 PM, BR_email <b...@dmstat1.com> wrote:
>>
>> Bill:
>> Thanks for reply.
>> Sorry, I do not understand it.
>> For example, where do I put "file.path(getwd(), ".Rprofile")" ?
> This is not the correct venue for questions about RStudio setup. Instead this questions should go to:
>
> https://support.rstudio.com/hc/en-us
>

______________________________________________

BR_email

unread,
Apr 15, 2017, 3:58:17 PM4/15/17
to Boris Steipe, r-h...@r-project.org
Boris:
As before, you assume that I, Bruce Ratner, just asks questions without
first trying it myself.
FYI: I purchased and read four RStudio books, as well as all the links I
found in the web.
I will not take your maligning me.
Please try to assist me, but do not bully me.
Bruce Ratner, Ph.D.

Jeff Newmiller

unread,
Apr 15, 2017, 4:09:29 PM4/15/17
to r-h...@r-project.org, BR_email, William Dunlap, r-h...@r-project.org
You type each expression interactively at the R console and look at the path it prints. Then you know where to look, or if no file exists there then you know where to put the file you want to be there.
--
Sent from my phone. Please excuse my brevity.

David Winsemius

unread,
Apr 15, 2017, 4:10:45 PM4/15/17
to Boris Steipe, r-h...@r-project.org, BR_email

> On Apr 15, 2017, at 12:46 PM, Boris Steipe <boris....@utoronto.ca> wrote:
>
> As with R, do with RStudio: Read The Beautiful Manual, and peruse The Google. For example, searching Google with the two (admittedly hard to guess) cryptograms:
> "RStudio Rprofile"
>
> will present more than a dozen most enlightening links to fulfil your desire.
>
> Perhaps the following link works better for you though:
> https://www.bing.com/search?q=rstudio+rprofile

Another promising search strategy would be SO with "[rstudio]" in the tags:

http://stackoverflow.com/search?q=%5Brstudio%5D+rprofile+windows

--
david.
David Winsemius
Alameda, CA, USA

Henrik Bengtsson

unread,
Apr 15, 2017, 6:19:53 PM4/15/17
to David Winsemius, r-h...@r-project.org, BR_email
Hi.

First, there should be no difference in where and how R and RStudio
locate the R startup file.

Second, if there is an .Rprofile in the working directory (i.e.
./.Rprofile), then that file with have higher priority than the file
located in ~/.Rprofile. You can use the following R calls, also on
Windows, to check if you have either of these two files:

> file <- normalizePath("./.Rprofile")
> file
> file.exist(file)

> file <- normalizePath("~/.Rprofile")
> file
> file.exist(file)

In my case, my working directory is C:/Users/hb/Documents/Projects/, I
have a ~/.Rprofile file, but not a .Rprofile in the working directory.
So, I get:

> file <- normalizePath("./.Rprofile")
> file
[1] "C:\\Users\\hb\\Documents\\Projects\\.Rprofile"
> file.exists(file)
[1] FALSE

> file <- normalizePath("~/.Rprofile")
> file
[1] "C:\\Users\\hb\\Documents\\.Rprofile"
> file.exists(file)
[1] TRUE

This tells me that my startup file that R tries to load / source
during startup is "C:\\Users\\hb\\Documents\\.Rprofile" and that's the
one I should edit.

BTW, the value of normalizePath("~/.Rprofile") and
file.path(Sys.getenv("HOME"), ".Rprofile") should point to the same
file, expect that normalizePath() makes all backward slashed on
Windows; the former is just a neater version to use:

> normalizePath("~/.Rprofile")
[1] "C:\\Users\\hb\\Documents\\.Rprofile"

> file.path(Sys.getenv("HOME"), ".Rprofile")
[1] "C:/Users/hb/Documents/.Rprofile"

> normalizePath(file.path(Sys.getenv("HOME"), ".Rprofile"))
[1] "C:\\Users\\hb\\Documents\\.Rprofile"

(all of the above reference the same file).

So, if file.exists(normalizePath("~/.Rprofile")) gives FALSE, then you
don't have that file. If you think you've edited that, then it might
be that you hit the peculiar Windows property where it hides the
filename extension from you in the Explorer. It might be that you
instead have created / edited the file:

normalizePath("~/.Rprofile.txt")

That often happens when one uses Notepad and saves the file as
.Rprofile - Notepad simply add a *.txt filename extension unless you
save it with quotation marks in the Save-As panel.

Now, if you indeed have the file:

normalizePath("~/.Rprofile")

then there is one last annoyance in R that you might have hit. If you're last
line in that file does not have a newline, the the file will be
silently ignored by R when R start. There won't be a warning - not
even a message. That is true for all OSes. It's a "feature" that
should really be fixed, because I keep seeing it tricking beginners
and advanced R users all the times. The easiest way to check if this
is your problem, use readLines() to read in the content; readLines()
will give a warning if the last line doesn't have a new line, e.g.

> readLines(normalizePath("~/.Rprofile"))
[1] "options(prompt=\"R> \")" "set.seed(12345)"
Warning message:
In readLines(normalizePath("~/.Rprofile")) :
incomplete final line found on 'C:\Users\hb\Documents\.Rprofile'

If you don't see the warning message, you should be fine.

Finally, an easy way to setup a ~/.Rprofile startup file is to do it
from within R, e.g.

> cat('options(prompt="R> ")\n', file = "~/.Rprofile")
> cat('set.seed(12345)\n', file = "~/.Rprofile", append = TRUE)

The '\n' at the end of each string represents a newline character, so
make sure you don't forget those.

Hope this help

Henrik

John C Frain

unread,
Apr 15, 2017, 7:16:59 PM4/15/17
to Henrik Bengtsson, r-h...@r-project.org, BR_email
If you have your Rprofile.site file in the default place you will need to
start whatever editor you are using in administrator mode to save your
changes. At least that is so on my PC with windows 10 with R installed in
the default directory. I use notepad++ in administrator mode. I presume
that you could do the same with rstudio.

If you think that answers are short or to the point remember that someone
is giving of his time to help you. I think that you owe someone an apology.

John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:fra...@tcd.ie
mailto:fra...@gmail.com

On 15 April 2017 at 23:19, Henrik Bengtsson <henrik.b...@gmail.com>
wrote:
> >> and provide commented, minimal, self-contained, reproducible code.
> >
> > David Winsemius
> > Alameda, CA, USA
> >
> > ______________________________________________
> > R-h...@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > 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.
>
> ______________________________________________
> R-h...@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

[[alternative HTML version deleted]]

Rolf Turner

unread,
Apr 15, 2017, 7:24:30 PM4/15/17
to BR_email, r-h...@r-project.org
On 16/04/17 07:57, BR_email wrote:
> Boris:
> As before, you assume that I, Bruce Ratner, just asks questions without
> first trying it myself.
> FYI: I purchased and read four RStudio books, as well as all the links I
> found in the web.
> I will not take your maligning me.
> Please try to assist me, but do not bully me.
> Bruce Ratner, Ph.D.

Bruce, you are being preciously hypersensitive. Boris's comment was
completely appropriate and betrayed not the slightest trace of
"bullying". If you had indeed done your homework in the manner that
Boris recommended you would had no need to clutter this mailing list
with your (off-topic) question.

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

BR_email

unread,
Apr 15, 2017, 7:46:44 PM4/15/17
to John C Frain, Henrik Bengtsson, r-h...@r-project.org
John:
Thanks for your help.

Regarding an apology to Boris. No. He is a condescending person.
On the three requests for help, which I made since starting with R, he
tells me to read the manuals, blogs, etc.,
while persons like you offer help. That is not strange?
My three questions Boris replies with nothing, yet others feel my
request is genuine and offer assistance.

I spend hours and hours reading the manuals, blogs, and purchasing and
reading multiple books on R and RStudio.
After that, when I am stuck, I go to the r-help.

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

John C Frain wrote:
> If you have your Rprofile.site file in the default place you will need
> to start whatever editor you are using in administrator mode to save
> your changes. At least that is so on my PC with windows 10 with R
> installed in the default directory. I use notepad++ in administrator
> mode. I presume that you could do the same with rstudio.
>
> If you think that answers are short or to the point remember that
> someone is giving of his time to help you. I think that you owe
> someone an apology.
>
> John C Frain
> 3 Aranleigh Park
> Rathfarnham
> Dublin 14
> Ireland
> www.tcd.ie/Economics/staff/frainj/home.html

> <http://www.tcd.ie/Economics/staff/frainj/home.html>
> mailto:fra...@tcd.ie <mailto:fra...@tcd.ie>
> mailto:fra...@gmail.com <mailto:fra...@gmail.com>


>
> On 15 April 2017 at 23:19, Henrik Bengtsson

> <boris....@utoronto.ca <mailto:boris....@utoronto.ca>> wrote:
> >>
> >> As with R, do with RStudio: Read The Beautiful Manual, and
> peruse The Google. For example, searching Google with the two
> (admittedly hard to guess) cryptograms:
> >> "RStudio Rprofile"
> >>
> >> will present more than a dozen most enlightening links to
> fulfil your desire.
> >>
> >> Perhaps the following link works better for you though:
> >> https://www.bing.com/search?q=rstudio+rprofile
> <https://www.bing.com/search?q=rstudio+rprofile>
> >
> > Another promising search strategy would be SO with "[rstudio]"
> in the tags:
> >
> > http://stackoverflow.com/search?q=%5Brstudio%5D+rprofile+windows
> <http://stackoverflow.com/search?q=%5Brstudio%5D+rprofile+windows>
> >
> > --
> > david.
> >>
> >> B.
> >>
> >>
> >>> On Apr 15, 2017, at 3:14 PM, BR_email <b...@dmstat1.com

> <mailto:b...@dmstat1.com>> wrote:
> >>>
> >>> Bill:
> >>> Thanks for reply.
> >>> Sorry, I do not understand it.
> >>> For example, where do I put "file.path(getwd(), ".Rprofile")" ?
> >>>
> >>> Bruce
> >>>
> >>>
> >>> William Dunlap wrote:
> >>>> I think the site-specific R profile should be, using R syntax
> >>>> file.path(R.home("etc"), "Rprofile.site") # no dot before
> the capital R
> >>>> The personal R profile will be
> >>>> file.path(Sys.getenv("HOME"), ".Rprofile") # there is a dot
> before capital R
> >>>> but if a local R profile,
> >>>> file.path(getwd(), ".Rprofile") # there is a dot before
> capital R
> >>>> exists it will be used and the one in HOME will not be.
> (getwd() should
> >>>> be the startup directory.)
> >>>>
> >>>>
> >>>> Bill Dunlap
> >>>> TIBCO Software

> >>>> wdunlap tibco.com <http://tibco.com>


> >>>>
> >>>>
> >>>> On Sat, Apr 15, 2017 at 9:06 AM, BR_email <b...@dmstat1.com
> <mailto:b...@dmstat1.com>> wrote:
> >>>>> Hi R-helpers:
> >>>>> Can you offer assistance in my getting .Rprofile and
> .Rprofile.site to run
> >>>>> in RStudio?
> >>>>> When I start RStudio nothing happens.
> >>>>> I have put .Rprofile in [1] and [2], and .Rprofile.site in [2].
> >>>>>
> >>>>> Below, the info I believe you need to know.
> >>>>> Thanks, in advance, for any help.
> >>>>> Bruce
> >>>>>
> >>>>> The .Rprofile and .Rprofile.site are R-type files, which
> contain the two
> >>>>> lines below.
> >>>>> Also, I tried the profile files as text files.
> >>>>> options(prompt="R> ")
> >>>>> set.seed(12345)
> >>>>>
> >>>>>> Sys.getenv("HOME") [1] "C:/Users/BruceRatner/Documents"
> >>>>>> Sys.getenv("R_HOME") [2] "C:/PROGRA~1/R/R-33~1.3"
> >>>>>
> >>>>>
> >>>>> --
> >>>>>
> >>>>> ______________________________________________

> >>>>> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing


> list -- To UNSUBSCRIBE and more, see
> >>>>> https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> >>>>> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> >>>>> and provide commented, minimal, self-contained, reproducible
> code.
> >>>>
> >>>>
> >>>

> >>> ______________________________________________
> >>> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing


> list -- To UNSUBSCRIBE and more, see
> >>> https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> >>> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> >>> and provide commented, minimal, self-contained, reproducible code.
> >>

> >> ______________________________________________
> >> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing list


> -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> >> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> >> and provide commented, minimal, self-contained, reproducible code.
> >

> > David Winsemius
> > Alameda, CA, USA
> >
> > ______________________________________________

> > R-h...@r-project.org <mailto:R-h...@r-project.org> mailing list


> -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> > and provide commented, minimal, self-contained, reproducible code.
>

> ______________________________________________
> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing list --


> To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help

Jeff Newmiller

unread,
Apr 15, 2017, 8:08:51 PM4/15/17
to r-h...@r-project.org, Rolf Turner, BR_email, r-h...@r-project.org
Well, to be fair, .Rprofile is an R configuration file, so it was merely the subject line that was off-topic.
--
Sent from my phone. Please excuse my brevity.

On April 15, 2017 4:24:06 PM PDT, Rolf Turner <r.tu...@auckland.ac.nz> wrote:
>On 16/04/17 07:57, BR_email wrote:
>> Boris:
>> As before, you assume that I, Bruce Ratner, just asks questions
>without
>> first trying it myself.
>> FYI: I purchased and read four RStudio books, as well as all the
>links I
>> found in the web.
>> I will not take your maligning me.
>> Please try to assist me, but do not bully me.
>> Bruce Ratner, Ph.D.
>
>Bruce, you are being preciously hypersensitive. Boris's comment was
>completely appropriate and betrayed not the slightest trace of
>"bullying". If you had indeed done your homework in the manner that
>Boris recommended you would had no need to clutter this mailing list
>with your (off-topic) question.
>
>cheers,
>
>Rolf Turner

John C Frain

unread,
Apr 16, 2017, 4:47:21 PM4/16/17
to Jeff Newmiller, r-h...@r-project.org, BR_email
Bruce

The official documentation for these startup files can be obtained with the
command

Help(Startup)

at the R prompt or through search help in R studio. I have used R in
various versions of Windows and Linux using the console version of R and
various IDEs including Rstudio and these have always worked as expected.
Rstudio has no specific effect on the location or use of these files. Now,
I only have access to PCs with windows 10 and can not check if there is any
specific problem with windows 7. I did use the startup files in earlier
versions of windows and have no recollection of any problems. There are
some peculiarities with Windows that you might check.

Henrik has outlined some of the problems that may arise with file name
extensions. Windows does not display extensions for file names with known
extensions. Many windows programs add their file extension to files when
they save them. I used to recommend to students that they configure windows
explorer to display file extensions. This is relatively easy to do in
Windows explorer in any version of windows. needless to say many students
ignored this advice and later ran into problems.

Windows may have problems saving files that start with a period. I use
notepad++ as a general test editor. On my system notepad++ can save files
whose names start with a period. The editor in Rstudio can also do so on my
system. I do remember having problems with an earlier version of Windows.

On windows 10 one must right click on the notepad++ or other editor icon
and select run as administrator to edit a file in the Program Files
directory. I don't remember to what extent this applies to Windows 7.

I have worked over the years with many people who were not native English
speakers even though they spoke very good English. The tone of their
interventions could sometimes cause problems. I think that the links that
you were given would have gone some way to solving your problem. I don't
think that the language used was intended to bully or cause offence. I
still think that an apology is in order. If someone volunteers an answer
look at its content rather than its brevity, tone or use of language. This
list depends on volunteers and they should be thanked rather than maligned.

John C Frain
3 Aranleigh Park
Rathfarnham
Dublin 14
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:fra...@tcd.ie
mailto:fra...@gmail.com
[[alternative HTML version deleted]]

Bruce Ratner PhD

unread,
Apr 16, 2017, 5:55:34 PM4/16/17
to John C Frain, r-h...@r-project.org
Dear John:
Thank you so much for your continued support. You are exceptional.
I have followed everything you stated with no success.
Prior to asking a question, I promise you my style is "to solve it myself."
I read everything on the web, and purchased and read $200 in books.

I hate to repeat, but on the only three questions I ever submitted to R-help , since I started with R, I received several technical suggestions of what to do.
Yet, Boris replied all three times with "read the manuals, go to websites, and stop spamming."
I'm sorry, but Boris' implies that I haven't done the basics and I want someone to just give me the answer to my question.

Those who reply with positive suggestions vs. Boris who tells me that he's not going to do my due diligence - indicates Boris' condescending attitude. I don't know why he responds to my last two questions, given I politely informed him that I have done the basic reading, etc?

Regardless, you are professional, helpful, and very proper.
Unfortunately, I don't think I will use R-help, in fear of Boris.

Bruce
______________
Bruce Ratner PhD
The Significant Statistician™
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net

Rolf Turner

unread,
Apr 16, 2017, 6:08:50 PM4/16/17
to John C Frain, r-h...@r-project.org, BR_email

On 17/04/17 08:46, John C Frain wrote:

> Bruce
>
> The official documentation for these startup files can be obtained with
> the command
>
> Help(Startup)


Minor point of order, Mr. Chairman. That should be:

help(Startup)

There is (as far as I know) no such function as "Help()". It is
important to remember that R is case sensitive.

Another point that is worthy of thought is "How in God's name would any
beginner know or find out about the usage help(Startup)?" Unless they
were explicitly told about it, in the manner which you just
demonstrated. The usage gets a mention in "An Introduction to R" ---
but I had to search for it.

To me the word "startup" is not terribly intuitive. I would tend to
search for "starting" rather than "startup", I think, but I'm not sure
what the average beginner would search for. A search of "An
Introduction to R" for "starting" gets seven or eight hits, one of which
is relevant. So it all takes patience and persistence.

Also note that "An Introduction to R" mostly uses the word "startup"
(lower case "s") and only uses "Startup" twice. Note also that

help(startup)

fails. You have to get that initial "S" right.

This isn't a criticism of the documentation. I'm just pointing out that
there are problems, mostly insoluble. Until some clever Johnny gets on
with developing that mind_read() function referred to in fortune(182).

cheers,

Rolf Turner

--
Technical Editor ANZJS
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

peter dalgaard

unread,
Apr 16, 2017, 6:13:40 PM4/16/17
to Rolf Turner, r-h...@r-project.org, BR_email
Um, tried help(.Rprofile) lately?

-pd
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk Priv: PDa...@gmail.com

BR_email

unread,
Apr 16, 2017, 6:43:50 PM4/16/17
to peter dalgaard, Rolf Turner, r-h...@r-project.org
Peter:
Thanks for reply and suggestion.
Sorry, I am not sure how to assess.
The doc is too technical for me to understand.
I found multiple instructions online and in R and RStudio books.
I'm doing what it says, but no success.
The instructions are simple as a-b-c, but some setting within the
Windows system must be the culprit.

Regards,
Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544

Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

peter dalgaard

unread,
Apr 16, 2017, 7:19:27 PM4/16/17
to BR_email, r-h...@r-project.org
That was aimed at Rolf...

For the actual question, I think the best approach would be to follow up on Bill Dunlap's suggestion. The mails from Jeff and Henrik pretty much tell you step by step what to try to find out which files on yours system are being checked in order to find startup code.

-pd

--

Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk Priv: PDa...@gmail.com

______________________________________________

David Winsemius

unread,
Apr 16, 2017, 7:34:37 PM4/16/17
to BR_email, r-h...@r-project.org, peter dalgaard

> On Apr 16, 2017, at 3:43 PM, BR_email <b...@dmstat1.com> wrote:
>
> Peter:
> Thanks for reply and suggestion.
> Sorry, I am not sure how to assess.
> The doc is too technical for me to understand.
> I found multiple instructions online and in R and RStudio books.
> I'm doing what it says, but no success.

What is "it" and what is "lack of success"?

> The instructions are simple as a-b-c, but some setting within the Windows system must be the culprit.

Although the RStudio page immediately below was done with a Mac, I suspect there are similar selection panels and dialogs on the Windows version of RStudio.

https://support.rstudio.com/hc/en-us/articles/200549016#general

When I look at the Windows installation advice I see near the top: "When installing on a 64-bit version of Windows the options will include 32- or 64-bit versions of R (and the default is to install both)." So is it possible that RStudio is looking at a different version of R than you believe it should be, perhaps at the 32 bit R versus the 64 bit one? The result at the beginning of this thread makes me think you got the 32-bit one connected to RStudio.

And I say again: I believe problems in configuring RStudio are off-topic for Rhelp and you should have been searching or posting question either to the RStudio support or StackOverflow. Looking at the responses to the queries above and the ones found below, it appears to me that there are RStudio-specific issues that go beyond what is in the `help(Startup)` or equivalent `help(.Rprofile)` page. I gave an instance of an SO search upthread and I offer another SO search:

http://stackoverflow.com/search?tab=votes&q=%5brstudio%5d%20environment%20variables%20windows

I thought that this one below had potentially useful information, but I am not a Windows user (and you have not shown an inclination in offering a complete description of your efforts at following that advice. At any rate it would have been more appropriate to respond to the SO answers that were ineffective or to post a question there with full description of your efforts and content of your .Rprofile file and your current environment variable settings.)

http://stackoverflow.com/search?tab=votes&q=%5brstudio%5d%20rprofile%20windows

--
David

David Winsemius
Alameda, CA, USA

______________________________________________

Bruce Ratner PhD

unread,
Apr 17, 2017, 6:07:05 AM4/17/17
to David Winsemius, r-h...@r-project.org, peter dalgaard
David:
When I launch Rstudio the effects of the Rprofile do not show, e.g., I want the prompt to be "R> " instead of the default "> ". The former doesn't show.
Bruce

______________
Bruce Ratner PhD


The Significant Statistician™
(516) 791-3544

Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net

Bert Gunter

unread,
Apr 17, 2017, 10:31:15 AM4/17/17
to Bruce Ratner PhD, r-h...@r-project.org, peter dalgaard
I cannot add to the instructions that you have already been given
regarding .Rprofile.

But what code did you use in your .Rprofile to set the prompt? The
posting guide explicitly requests that you provide your code, although
maybe you already did earlier in this extensive thread.

?options

is how it can be set. Did you do this?

-- Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

Bruce Ratner PhD

unread,
Apr 17, 2017, 10:41:35 AM4/17/17
to Bert Gunter, r-h...@r-project.org, peter dalgaard
Bert:
I used note pad under Administrator. The code:
options(prompt="R> ")
set.seed(12345)

Bruce

______________
Bruce Ratner PhD
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net

William Dunlap via R-help

unread,
Apr 17, 2017, 11:07:26 AM4/17/17
to Bruce Ratner PhD, r-h...@r-project.org, peter dalgaard
I believe someone already mentioned it, but notepad makes it hard to
save a file without the ".txt" extension to its name. R does not do
anything with .Rprofile.txt, only .Rprofile, so you must figure out a
way to work around notepad's mangling of the file name.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

Henrik Bengtsson

unread,
Apr 17, 2017, 11:12:23 AM4/17/17
to Bruce Ratner PhD, r-h...@r-project.org, Peter Dalgaard
Did you try any of the troubleshooting I suggested? If you do that, I'm
99.99% certain it'll help you to resolve this.

Henrik

[[alternative HTML version deleted]]

BR_email

unread,
Apr 17, 2017, 11:14:09 AM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Bill:
I did workaround. I created the Rprofile files with file type R, not txt.
Bruce

Jeff Newmiller

unread,
Apr 17, 2017, 11:14:40 AM4/17/17
to r-h...@r-project.org, Bruce Ratner PhD, Bert Gunter, r-h...@r-project.org, peter dalgaard
Doing anything as Administrator means you are probably already in file permissions hell. R works great if you avoid Administrator mode entirely... using it raises the complexity of every step you take drastically.

--
Sent from my phone. Please excuse my brevity.

BR_email

unread,
Apr 17, 2017, 11:19:41 AM4/17/17
to Henrik Bengtsson, r-h...@r-project.org, Peter Dalgaard
Henrik:
The Rprofile file is there, I see it.

Bruce Ratner, Ph.D.

Henrik Bengtsson wrote:
> Did you try any of the troubleshooting I suggested? If you do that,
> I'm 99.99% certain it'll help you to resolve this.
>
> Henrik
>
>
> On Apr 17, 2017 03:07, "Bruce Ratner PhD" <b...@dmstat1.com

> <mailto:b...@dmstat1.com>> wrote:
>
> David:
> When I launch Rstudio the effects of the Rprofile do not show,
> e.g., I want the prompt to be "R> " instead of the default "> ".
> The former doesn't show.
> Bruce
>
> ______________
> Bruce Ratner PhD
> The Significant Statistician™

> (516) 791-3544 <tel:%28516%29%20791-3544>


> Statistical Predictive Analytics -- www.DMSTAT1.com

> <http://www.DMSTAT1.com>
> Machine-Learning Data Mining -- www.GenIQ.net <http://www.GenIQ.net>


>
>
>
> > On Apr 16, 2017, at 7:34 PM, David Winsemius

> <dwins...@comcast.net <mailto:dwins...@comcast.net>> wrote:
> >
> >
> >> On Apr 16, 2017, at 3:43 PM, BR_email <b...@dmstat1.com

> <http://stackoverflow.com/search?tab=votes&q=%5brstudio%5d%20environment%20variables%20windows>


> >
> > I thought that this one below had potentially useful
> information, but I am not a Windows user (and you have not shown
> an inclination in offering a complete description of your efforts
> at following that advice. At any rate it would have been more
> appropriate to respond to the SO answers that were ineffective or
> to post a question there with full description of your efforts and
> content of your .Rprofile file and your current environment
> variable settings.)
> >
> >
> http://stackoverflow.com/search?tab=votes&q=%5brstudio%5d%20rprofile%20windows

> <http://stackoverflow.com/search?tab=votes&q=%5brstudio%5d%20rprofile%20windows>


> >
> > --
> > David
> >
> >>
> >> Regards,
> >> Bruce
> >>
> >> Bruce Ratner, Ph.D.
> >> The Significant Statistician™

> >> (516) 791-3544 <tel:%28516%29%20791-3544>


> >> Statistical Predictive Analtyics -- www.DMSTAT1.com

> <http://www.DMSTAT1.com>


> >> Machine-Learning Data Mining and Modeling -- www.GenIQ.net

> <http://www.GenIQ.net>


> >>
> >> peter dalgaard wrote:
> >>> Um, tried help(.Rprofile) lately?
> >>>
> >>> -pd
> >>>
> >>>> On 17 Apr 2017, at 00:08 , Rolf Turner

> <tel:%2B64-9-373-7599%20ext.%2088276>
> >>>>
> >>>> ______________________________________________
> >>>> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing


> list -- To UNSUBSCRIBE and more, see
> >>>> https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> >>>> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> >>>> and provide commented, minimal, self-contained, reproducible
> code.
> >>

> >> ______________________________________________
> >> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing list


> -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help

> <https://stat.ethz.ch/mailman/listinfo/r-help>
> >> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> <http://www.R-project.org/posting-guide.html>
> >> and provide commented, minimal, self-contained, reproducible code.
> >

> > David Winsemius
> > Alameda, CA, USA
> >
> >
>
> ______________________________________________

> R-h...@r-project.org <mailto:R-h...@r-project.org> mailing list --


> To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help

William Dunlap via R-help

unread,
Apr 17, 2017, 11:21:21 AM4/17/17
to Bruce Ratner PhD, r-h...@r-project.org, peter dalgaard
Use the R command
dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile")
to see if there are any file names with the unwanted ".txt" and use
file.rename() to fix them up.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

William Dunlap via R-help

unread,
Apr 17, 2017, 11:22:11 AM4/17/17
to BR_email, r-h...@r-project.org, peter dalgaard
Not file exention ".R" - no file exention at all.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

BR_email

unread,
Apr 17, 2017, 11:22:26 AM4/17/17
to Jeff Newmiller, r-h...@r-project.org, Bert Gunter, peter dalgaard
I did it both ways, with and without: no success.

Bruce Ratner, Ph.D.


The Significant Statistician™
(516) 791-3544

Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

Jeff Newmiller wrote:
> Doing anything as Administrator means you are probably already in file permissions hell. R works great if you avoid Administrator mode entirely... using it raises the complexity of every step you take drastically.

______________________________________________

BR_email

unread,
Apr 17, 2017, 11:24:42 AM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Bill:
Here's what I got:

dir(c(".", Sys.getenv("HOME"), R.home("etc")), pattern="Rprofile") [1] "Rprofile.site"


Bruce Ratner, Ph.D.


The Significant Statistician™
(516) 791-3544

Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

BR_email

unread,
Apr 17, 2017, 11:26:30 AM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
I used not extension, but R extension shows up.

Bruce Ratner, Ph.D.


The Significant Statistician™
(516) 791-3544

Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

William Dunlap via R-help

unread,
Apr 17, 2017, 11:31:25 AM4/17/17
to BR_email, r-h...@r-project.org, peter dalgaard
I should haved added full.names=TRUE to the dir() call. I you add
that I'd expect that you would see ".../etc/Rprofile.site". What do
you see when you do

writeLines(readLines(".../etc/Rprofile.site")

and
source(echo=TRUE, ".../etc/Rprofile.site")

(replace the ellipsis by whatever dir(full.names=TRUE,...) showed).


Bill Dunlap
TIBCO Software
wdunlap tibco.com

William Dunlap via R-help

unread,
Apr 17, 2017, 11:32:48 AM4/17/17
to BR_email, r-h...@r-project.org, peter dalgaard
Use another editor or go to file explorer, turn on the 'show file
extensions' option and rename the file so it does not have the .R
extension.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

BR_email

unread,
Apr 17, 2017, 11:37:13 AM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Bill:
I feel you are nailing it for me.
Can I please call you, but I am getting a little lost, and losing your
valuable help?
Bruce

William Dunlap via R-help

unread,
Apr 17, 2017, 11:54:34 AM4/17/17
to BR_email, r-h...@r-project.org, peter dalgaard
No calls please. Just show the group what .../etc/Rprofile-site contained.

Bill Dunlap
TIBCO Software
wdunlap tibco.com

BR_email

unread,
Apr 17, 2017, 12:02:31 PM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Sorry for the phone suggestion.
Bill, I do not know what type of editor to use, can you suggest?
BR

BR_email

unread,
Apr 17, 2017, 12:36:32 PM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Bill:
Success, almost there:

>writeLines(readLines("C:/Users/BruceRatner/Documents/.Rprofile.site")) options(prompt="R> ")
set.seed(12345)
rm(list=ls())

>


Yet, still not affecting the launch, as "R>" is not there.
Any suggestions, please. "So close, yet far away, ... " - Carly Simon

BR_email

unread,
Apr 17, 2017, 12:40:11 PM4/17/17
to William Dunlap, r-h...@r-project.org, peter dalgaard
Bill, part II:

>source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")
Error: unexpected symbol in "source(echo=TRUE, ""C"

>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

Berend Hasselman

unread,
Apr 17, 2017, 12:54:38 PM4/17/17
to BR_email, r-h...@r-project.org, peter dalgaard

> On 17 Apr 2017, at 18:39, BR_email <b...@dmstat1.com> wrote:
>
> Bill, part II:
>
>> source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")
> Error: unexpected symbol in "source(echo=TRUE, ""C"
>

You have a double quote sign ("") preceding C:/.
Make it a single double quote so that you get "C:/...."

Berend

BR_email

unread,
Apr 17, 2017, 1:02:09 PM4/17/17
to Berend Hasselman, r-h...@r-project.org, peter dalgaard
Berend: Something looks good, but RStudio still Rprofile still doees not
affect the launch.

>source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
> options(prompt="R> ")

> set.seed(12345)

> rm(list=ls())

R>


Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

Berend Hasselman wrote:
> source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")

Jeff Newmiller

unread,
Apr 17, 2017, 1:19:19 PM4/17/17
to r-h...@r-project.org, BR_email, William Dunlap, r-h...@r-project.org, peter dalgaard
".Rprofile.site" is not looked for in "C:/Users/BruceRatner/Documents/". That file belongs in the R.home("etc") directory. I suggest you stay away from the system wide configuration and focus on your personal configuration file ""C:/Users/BruceRatner/Documents/.Rprofile".

I also recommend putting the arguments in the order given in ?source unless you name every single argument.


--
Sent from my phone. Please excuse my brevity.

Peter Dalgaard

unread,
Apr 17, 2017, 1:26:30 PM4/17/17
to BR_email, r-h...@r-project.org

> On 17 Apr 2017, at 19:01 , BR_email <b...@dmstat1.com> wrote:
>
> Berend: Something looks good, but RStudio still Rprofile still doees not affect the launch.
>
>> source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
>> options(prompt="R> ")
>
>> set.seed(12345)
>
>> rm(list=ls())
>
> R>
>
>
> Bruce Ratner, Ph.D.
> The Significant Statistician™
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>
> Berend Hasselman wrote:
>> source(echo=TRUE, ""C:/Users/BruceRatner/Documents/.Rprofile.site")
>

According to the gospel of St.Henrik, that filename is wrong, and possibly the directory too.

So try his suggestions. What is the output (show us!) of

normalizePath("./.Rprofile")
normalizePath("~/.Rprofile")

Assuming that the former is

"C:/Users/BruceRatner/Documents/.Rprofile"

you could try renaming the .Rprofile.site file to that. If need be, use file.rename, as in

file.rename(from="C:/Users/BruceRatner/Documents/.Rprofile.site", to="C:/Users/BruceRatner/Documents/.Rprofile")

(and restart, obviously).

[I wouldn't set the seed in a .Rprofile file, nor would I use rm() there, but that is a different kettle of fish.]

--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd....@cbs.dk Priv: PDa...@gmail.com

______________________________________________

BR_email

unread,
Apr 17, 2017, 1:47:29 PM4/17/17
to Peter Dalgaard, Berend Hasselman, William Dunlap, Boris Steipe, r-h...@r-project.org
TO _ALL_:
THANK YOU. THANK YOU. THANK YOU.
After hours, and hours, and hours, and ... , and hours: Success.
To all who helped, thanks.
My quest was minor, but major for me, as I learn from the path of one,
whether big or small begets another.

I never look down at anyone, except to help him/her up.

With gratitude,
Bruce

Bruce Ratner, Ph.D.
The Significant Statistician™
(516) 791-3544
Statistical Predictive Analtyics -- www.DMSTAT1.com
Machine-Learning Data Mining and Modeling -- www.GenIQ.net

______________________________________________

BR_email

unread,
Apr 17, 2017, 6:04:48 PM4/17/17
to Peter Dalgaard, Berend Hasselman, William Dunlap, Boris Steipe, r-h...@r-project.org
To _ALL_ who helped me.
In the final analysis, I was doing everything correctly, as per the
manuals, the links, and the books I bought.
However, in all the material, it never read mention of creating of the
.Rprofile file
with a programmer/developer text editor, which allows for no extension,
no R, no txt.

You guys drilled down, and hit solid gold for me,
which lead to my understanding the issue, at least as I see it.

Pure GOLD Medal team work.
Again, I truly thank you.
Bruce

Sparks, John James

unread,
Apr 18, 2017, 9:52:45 AM4/18/17
to BR_email, r-h...@r-project.org, Peter Dalgaard
Bruce,

Do you think that you could post the final solution to the problem? That
way it would be stored with this thread and the next person who has the
same problem would be able to locate the FINAL solution.

--JJS


On Mon, April 17, 2017 12:47 pm, BR_email wrote:
> TO _ALL_:
> THANK YOU. THANK YOU. THANK YOU.
> After hours, and hours, and hours, and ... , and hours: Success.
> To all who helped, thanks.
> My quest was minor, but major for me, as I learn from the path of one,
> whether big or small begets another.
>
> I never look down at anyone, except to help him/her up.
>
> With gratitude,
> Bruce
>
> Bruce Ratner, Ph.D.
> The Significant Statisticianâ„¢
> (516) 791-3544
> Statistical Predictive Analtyics -- www.DMSTAT1.com
> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>
>
> Peter Dalgaard wrote:
>>> On 17 Apr 2017, at 19:01 , BR_email <b...@dmstat1.com> wrote:
>>>
>>> Berend: Something looks good, but RStudio still Rprofile still doees
>>> not affect the launch.
>>>
>>>> source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
>>>> options(prompt="R> ")
>>>> set.seed(12345)
>>>> rm(list=ls())
>>> R>
>>>
>>>
>>> Bruce Ratner, Ph.D.
>>> The Significant Statisticianâ„¢

Bruce Ratner PhD

unread,
Apr 18, 2017, 11:27:15 AM4/18/17
to Sparks, John James, r-h...@r-project.org, Peter Dalgaard
Dear John:
My pleasure to respond to your request.
Problem: Cannot get the .Rprofile file to take affect in either R (or RStudio).
As to "what" can be in put into a .Rprofile file is abound, many examples in the manuals, blogs, links, and books.

The "how to" write the file was the real issue, not clearly covered in any material I could find or purchase.

I read that any notepad-type app can be used to create the .Rprofile file:
1. with or without a txt/R extension, and/or
2. with or without Administrator permission.

Not being a professional programmer/developer, I did not know about text editors that can create files with no extension, which was the problem at hand.

After many back and forth drilling down by R-helpers with trouble shooting queries, it became clear that I was not using a developer's text editor.

Solution: I found an editor online, EditPad Pro 7 (for Windows), with which I created my .Rprofile file.

The result was complete success, and gratitude to all R-helpers who stuck by me,
understanding I am new to R, with non professional programming skills. As a statistician (or if you prefer data scientist) for twenty plus years, clearly I must know how to program, but not at the pro level or pro understanding.

John, I hope this write up is satisfactory, if not please let let me know, as I will rewrite until you are happy with it.

It is a nice surprise to hear your wanting to archive the problem-solution, which almost did me in, and which created ill feelings among several R-helpers towards me.

Regards,
Bruce

______________
Bruce Ratner PhD


The Significant Statistician™
(516) 791-3544

Statistical Predictive Analytics -- www.DMSTAT1.com
Machine-Learning Data Mining -- www.GenIQ.net

> On Apr 18, 2017, at 9:52 AM, Sparks, John James <jsp...@uic.edu> wrote:
>
> Bruce,
>
> Do you think that you could post the final solution to the problem? That
> way it would be stored with this thread and the next person who has the
> same problem would be able to locate the FINAL solution.
>
> --JJS
>
>
>> On Mon, April 17, 2017 12:47 pm, BR_email wrote:
>> TO _ALL_:
>> THANK YOU. THANK YOU. THANK YOU.
>> After hours, and hours, and hours, and ... , and hours: Success.
>> To all who helped, thanks.
>> My quest was minor, but major for me, as I learn from the path of one,
>> whether big or small begets another.
>>
>> I never look down at anyone, except to help him/her up.
>>
>> With gratitude,
>> Bruce
>>
>> Bruce Ratner, Ph.D.

>> The Significant Statistician™


>> (516) 791-3544
>> Statistical Predictive Analtyics -- www.DMSTAT1.com
>> Machine-Learning Data Mining and Modeling -- www.GenIQ.net
>>
>>
>> Peter Dalgaard wrote:
>>>> On 17 Apr 2017, at 19:01 , BR_email <b...@dmstat1.com> wrote:
>>>>
>>>> Berend: Something looks good, but RStudio still Rprofile still doees
>>>> not affect the launch.
>>>>
>>>>> source(echo=TRUE, "C:/Users/BruceRatner/Documents/.Rprofile.site")
>>>>> options(prompt="R> ")
>>>>> set.seed(12345)
>>>>> rm(list=ls())
>>>> R>
>>>>
>>>>
>>>> Bruce Ratner, Ph.D.

>>>> The Significant Statistician™

Henrik Bengtsson

unread,
Apr 19, 2017, 3:39:41 PM4/19/17
to Bruce Ratner PhD, r-h...@r-project.org, Peter Dalgaard
I'd be really surprised if basically not all text editors could be
used here; it more that some have quirks making it less obvious. For
instance, with plain old Notepad that comes with all Windows distros
you can put (double) quotes around the file name in the Save As...
dialog to prevent Notepad from adding it's own default *.txt extension
(when the extension is missing). BTW, since you're using RStudio, you
can also use that to create your .Rprofile file; RStudio's Save As...
does not mess with the filename - it saves the file as you specify.

Bruce, what I think would have helped helping you here early on is if
you had given a bit more details on what you did / tried. There was a
lot of "does not work" early on, which gives little clues. It wasn't
clear where you saved the files. Maybe you weren't sure yourself, but
even knowing so would have helped help you. It was also not clear how
much experience you had with R, which caused confusion - knowing "new
to R, with non professional programming skills" would probably have
cut some corners. As a helper, here and on other forums, it's often
hard to guess this and to provide a proper reply is then hard - like
trying to give a scientific presentation when you don't know who's in
the audience. This happens all the time and most people quickly picks
up what the expectations are and then get a smoother ride going
forward.

/Henrik

PS. With the risk of adding confusion, unless you already do so, you
should focus on only using/editing your
C:/Users/BruceRatner/Documents/.Rprofile (also referred to as
~/.Rprofile) file. That one does not require any Administrative
rights to edit and has the advantage of working also when you update R
later. The C:/PROGRA~1/R/R-33~1.3/etc/.Rprofile.site file requires
Admin to edit and will have to be recreated/reedited whenever you
update R (e.g. R 3.4.0 will install in a different directory). A
regular R user should never have to edit the latter. It's mostly used
for system admins who wish to set common startup settings for multiple
users in a location file. The *.site part of .Rprofile.site suggests
site-wide settings. So, use ~/.Rprofile to control your R startup
settings.

BR_email

unread,
Apr 19, 2017, 3:58:06 PM4/19/17
to Henrik Bengtsson, r-h...@r-project.org, Peter Dalgaard
Henrik:
Your points are well taken.
My biggest mistake was that I thought my question was an easy one.
But as you rightly stated, I did not explicitly provide my background.
I assumed my question implied how much I did not know, beyond being new
to R.
It's like Einstein teaching arithmetic, he would know his audience and
teach accordingly.

It was tough on me (mentally draining) because I want to learn R
and just couldn't break through until I believe either you or Peter
picked up on my using notepad.

Well, I am glad you guys really want to help and must as I needed it.

Regards,
Bruce

John

unread,
Apr 19, 2017, 6:05:24 PM4/19/17
to r-h...@r-project.org
On Wed, 19 Apr 2017 15:57:42 -0400
BR_email <b...@dmstat1.com> wrote:

> Henrik:
> Your points are well taken.
> My biggest mistake was that I thought my question was an easy one.
> But as you rightly stated, I did not explicitly provide my background.
> I assumed my question implied how much I did not know, beyond being
> new to R.
> It's like Einstein teaching arithmetic, he would know his audience
> and teach accordingly.
>
> It was tough on me (mentally draining) because I want to learn R
> and just couldn't break through until I believe either you or Peter
> picked up on my using notepad.
>
> Well, I am glad you guys really want to help and must as I needed it.
>
> Regards,
> Bruce
>
Henrik's point about editors is very important since it has implications
well beyond editing something like .Rprofile. Depending on the scale
and kinds of data you work with, you may conclude that one of
the easiest means of getting data into R is through delimited, plain
text files. I tend to prefer tab-delimited files because the data I use
often contains descriptive fields that are useful to have, but often
contain commas, ruling out standard csv files. Many "text" editors in
both Windows and Linux routinely and quietly convert tabs to some
standard number of spaces. You want an editor that will produce
precisely what you tell it to. While you can pull delimited files into
Excel, a good text editor, not Notepad or Wordpad, such as Notepad++ in
Windows or Kwrite in Linux (both of which will save a tab as a tab
(though Kwrite needs to set to do so) and speed data formatting and
editing immensely. Also, if you are using RStudio you should consider
using the "project" capability. You will then never have to worry
about .Rproject again.

JWDougherty
Reply all
Reply to author
Forward
0 new messages