[R-SIG-Mac] Permanently fix R to open Help page in html

Marc Schwartz marc_schwartz at me.com
Tue Jul 11 16:59:50 CEST 2017


Christofer,

The thing is that you really don't need to do that (use .First), which makes this situation curious and why it would be helpful to see the full content of your .Rprofile file, to be sure that there is not a conflict in content or structure someplace.

An extra set of eyes might be helpful.

Marc

> On Jul 11, 2017, at 9:52 AM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
> 
> Hi,
> 
> I just put options(help_type = "html") inside .First <- function() {}
> and now it works. Help page is now opening in Browser.
> 
> Thanks all for your time and help. Regards,
> 
> 
> 
> On Tue, Jul 11, 2017 at 8:21 PM, Marc Schwartz <marc_schwartz at me.com> wrote:
>> Christofer,
>> 
>> Can you post your .Rprofile file someplace online (e.g. Dropbox) so that we can take a look at it?
>> 
>> Marc
>> 
>> 
>>> On Jul 11, 2017, at 9:48 AM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
>>> 
>>> Hi Ben,
>>> 
>>> I work with R from Terminal only.
>>> 
>>> If I explicitly set ' options(help_type = 'html')' after opening R in
>>> terminal, it works perfectly. Means, help page opens in Browser.
>>> 
>>> However I do not want to have this code ' options(help_type = 'html')'
>>> every time I open R. So I want R to set this option all time. Thats
>>> why I chose to create .RProfile file and put that code there. However
>>> in that case, it is not working.
>>> 
>>> Below is the snapshot like yours :
>>> 
>>> R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
>>> 
>>> Copyright (C) 2017 The R Foundation for Statistical Computing
>>> 
>>> Platform: x86_64-apple-darwin15.6.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.
>>> 
>>> 
>>> [Previously saved workspace restored]
>>> 
>>> 
>>>> ?sum
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> sum                    package:base                    R Documentation
>>> 
>>> 
>>> Sum of Vector Elements
>>> 
>>> 
>>> Description:
>>> 
>>> 
>>>    ‘sum’ returns the sum of all the values present in its arguments.
>>> 
>>> 
>>> Usage:
>>> 
>>> 
>>>    sum(..., na.rm = FALSE)
>>> 
>>> 
>>> 
>>> On Tue, Jul 11, 2017 at 7:45 PM, Ben Tupper <btupper at bigelow.org> wrote:
>>>> Hi,
>>>> 
>>>> I'm curious about what happens if you start a plain R session at the command line (not R.app) and set the option within the session.  Something like the following that open help in my browser.
>>>> 
>>>> $ R --vanilla
>>>> 
>>>> R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
>>>> Copyright (C) 2016 The R Foundation for Statistical Computing
>>>> Platform: x86_64-apple-darwin13.4.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.
>>>> 
>>>>> options(help_type = 'html')
>>>>> ?source
>>>> starting httpd help server ... done
>>>> 
>>>> Ben
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>>> On Jul 11, 2017, at 10:10 AM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
>>>>> 
>>>>> I am not getting error.
>>>>> 
>>>>> However help page is not opening in html.
>>>>> 
>>>>> On Tue, Jul 11, 2017 at 5:16 PM, Marc Schwartz <marc_schwartz at me.com> wrote:
>>>>>> 
>>>>>>> On Jul 10, 2017, at 10:33 PM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote:
>>>>>>> 
>>>>>>> Performed steps according to Marc's suggestions :
>>>>>>> 
>>>>>>> But not help page is not openning in Browser.
>>>>>> 
>>>>>> 
>>>>>> Are you getting the same error as before?
>>>>>> 
>>>>>> Do the single quotes still look like smart quotes or regular ASCII quotes?
>>>>>> 
>>>>>> Marc
>>>>>> 
>>>>>> 
>>>>>>> 
>>>>>>> On Tue, Jul 11, 2017 at 7:28 AM, Marc Schwartz <marc_schwartz at me.com> wrote:
>>>>>>>> 
>>>>>>>>> On Jul 10, 2017, at 5:19 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>>>>>>>>> 
>>>>>>>>> On 10/07/2017 5:02 PM, Christofer Bogaso wrote:
>>>>>>>>>> Hi,
>>>>>>>>>> 
>>>>>>>>>> I wanted R to open any Help page in html permanently.
>>>>>>>>>> 
>>>>>>>>>> So 1st I created .Rprofile file with below code in terminal:
>>>>>>>>>> 
>>>>>>>>>> touch ~/.Rprofile
>>>>>>>>>> 
>>>>>>>>>> open -a Textedit ~/.Rprofile
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> And then in the .Rprofile file, I wrote below code :
>>>>>>>>>> 
>>>>>>>>>> options(help_type = ‘html’)
>>>>>>>>>> 
>>>>>>>>>> However after that when I start R (from Terminal) I get below error on loading R
>>>>>>>>>> 
>>>>>>>>>> Error: 1:20: unexpected input
>>>>>>>>>> 
>>>>>>>>>> 1: options(help_type = ?
>>>>>>>>>> 
>>>>>>>>>>                   ^
>>>>>>>>> 
>>>>>>>>> Those don't look like ASCII quotes.  Use the R.app editor, not Textedit, and it won't put in funny "smart quotes".
>>>>>>>> 
>>>>>>>> 
>>>>>>>> Alternatively, you can set TextEdit to not use "Smart quotes"  by disabling them in:
>>>>>>>> 
>>>>>>>> Preferences -> New Document
>>>>>>>> 
>>>>>>>> There is a checkbox under Options for Smart quotes. Uncheck it.
>>>>>>>> 
>>>>>>>> Regards,
>>>>>>>> 
>>>>>>>> Marc Schwartz
>>>>>>>> 
>>>>>>>> 
>>>>>>>>> 
>>>>>>>>> Duncan Murdoch
>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> [Previously saved workspace restored]
>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>>> 
>>>>>>>>>> 
>>>>>>>>>> Can someone please point me on where I made mistake.
>>>>>>>>>> 
>>>>>>>>>> Thanks for your time.
>>>>>>>> 
>>>>>> 
>> 



More information about the R-SIG-Mac mailing list