Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
> Many, many thanks for all your timely efforts and considerable help,

Hear! Hear!  Thanks so much for sticking with us!   I now have populated help 
pages in R.app!  Yeha!

Cheers,
Ben

> On Oct 18, 2018, at 8:32 PM, zListserv  wrote:
> 
> Ha!  My /etc/hosts was empty (perhaps an error by Migration Assistant?).  
> Populating it with the /etc/hosts from the host computer (particularly 
> defining localhost) solves the problem.
> 
> Many, many thanks for all your timely efforts and considerable help,
> 
>> On 2018-10 -18, at 19:52, Marc Schwartz  wrote:
>> 
>> Hi,
>> 
> 
> 

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread zListserv
Ha!  My /etc/hosts was empty (perhaps an error by Migration Assistant?).  
Populating it with the /etc/hosts from the host computer (particularly defining 
localhost) solves the problem.

Many, many thanks for all your timely efforts and considerable help,

> On 2018-10 -18, at 19:52, Marc Schwartz  wrote:
> 
> Hi,
> 


___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Hi,

Ok, that confirms the issue, as surmised.

The default hosts file on macOS typically contains the following entries:

##
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost


Somewhere along the way, the content of that file has been changed and the 
above content deleted, possibly by whatever VPN configuration process was 
implemented at some point.

Ben, if you know how to edit and save the /etc/hosts file, which should require 
the admin password, add the above lines before the #BEGIN line in the file as 
it is now.

I would recommend saving the current version of the file, before you start 
editing, just in case. So, from the terminal, use something like:

  sudo cp /etc/hosts /etc/hosts.SAVE

If you are not sure how to edit the file, here is one resource:

  https://www.imore.com/how-edit-your-macs-hosts-file-and-why-you-would-want

and there are others online as well.

Once you do that, hopefully, that will resolve this issue.

Marc


> On Oct 18, 2018, at 6:34 PM, Ben Tupper  wrote:
> 
> Hi,
> 
> 
> ben@gale ~ $ ping localhost
> ping: cannot resolve localhost: Unknown host
> 
> Here's /etc/hosts in its entirety.
> 
> ben@gale ~ $ more /etc/hosts
> # BEGIN section for OpenVPN Client SSL sites
> 127.94.0.1  client.openvpn.net
> 127.94.0.2  openvpn-client.vpn.bigelow.org
> # END section for OpenVPN Client SSL sites
> 
> I'm not currently using VPN.
> 
> 
>> On Oct 18, 2018, at 6:29 PM, peter dalgaard  wrote:
>> 
>> Cannot _find_ localhost?? Can you do this (in a Terminal window) ?
>> 
>> Peter-Dalgaards-MacBook-Air:STAT pd$ ping localhost
>> PING localhost (127.0.0.1): 56 data bytes
>> Request timeout for icmp_seq 0
>> Request timeout for icmp_seq 1
>> ^C
>> --- localhost ping statistics ---
>> 3 packets transmitted, 0 packets received, 100.0% packet loss
>> 
>> If not, what is in the first couple of lines in /etc/hosts?
>> 
>> -pd
>> 
>>> On 19 Oct 2018, at 00:09 , Ben Tupper  wrote:
>>> 
>>> Just a little followup.  Switching the default browser from Firefox to 
>>> Safari yields a similar message in the browser after...
>>> 
>>> Browse[2]> browseURL(x)
>>> 
>>> 'Safari can't open the page "localhost:29682/library/utils/html/help.html"
>>> because Safari can't find the server "localhost".'
>>> 
>> 
>> -- 
>> 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
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 60 Bigelow Drive, P.O. Box 380
> East Boothbay, Maine 04544
> http://www.bigelow.org
> 
> Ecological Forecasting: https://eco.bigelow.org/
> 
> 
> 
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> ___
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Ok, I think that Peter and Duncan are on to the key issue here.

I have been trying to figure out what the difference is between displaying HTML 
help in R.app versus in the terminal and we now know.

If running R in R.app, where .Platform$GUI == "AQUA", the key line in the HTML 
browser display process is:

  x <- gsub("http://127.0.0.1 ", "http://localhost 
", x, fixed = TRUE)

where the IP address in the help file URL ('x') is changed to localhost. That 
does not happen when running R from the terminal and the IP address is used.

In other words, a url something like:

  "http://127.0.0.1:27572/library/graphics/html/plot.html;

gets regex'd to:

  "http://localhost:27572/library/graphics/html/plot.html;


Typically there is an entry in /etc/hosts that maps 127.0.0.1 to localhost. If 
that entry is not present, then the OS does not know how to map the domain 
'localhost' to a physical IP address, much like a DNS server could not map an 
internet domain name to a physical server IP address.

Ben, if you are not sure about how to look at /etc/hosts per Peter's message 
below, you can use:

  cat /etc/hosts | grep localhost

in a terminal and see what it returns.

Marc



> On Oct 18, 2018, at 6:29 PM, peter dalgaard  wrote:
> 
> Cannot _find_ localhost?? Can you do this (in a Terminal window) ?
> 
> Peter-Dalgaards-MacBook-Air:STAT pd$ ping localhost
> PING localhost (127.0.0.1): 56 data bytes
> Request timeout for icmp_seq 0
> Request timeout for icmp_seq 1
> ^C
> --- localhost ping statistics ---
> 3 packets transmitted, 0 packets received, 100.0% packet loss
> 
> If not, what is in the first couple of lines in /etc/hosts?
> 
> -pd
> 
>> On 19 Oct 2018, at 00:09 , Ben Tupper  wrote:
>> 
>> Just a little followup.  Switching the default browser from Firefox to 
>> Safari yields a similar message in the browser after...
>> 
>> Browse[2]> browseURL(x)
>> 
>> 'Safari can't open the page "localhost:29682/library/utils/html/help.html"
>> because Safari can't find the server "localhost".'
>> 
> 
> -- 
> 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
> 
> ___
> R-SIG-Mac mailing list
> R-SIG-Mac@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac


[[alternative HTML version deleted]]

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Hi,


ben@gale ~ $ ping localhost
ping: cannot resolve localhost: Unknown host

Here's /etc/hosts in its entirety.

ben@gale ~ $ more /etc/hosts
# BEGIN section for OpenVPN Client SSL sites
127.94.0.1  client.openvpn.net
127.94.0.2  openvpn-client.vpn.bigelow.org
# END section for OpenVPN Client SSL sites

I'm not currently using VPN.


> On Oct 18, 2018, at 6:29 PM, peter dalgaard  wrote:
> 
> Cannot _find_ localhost?? Can you do this (in a Terminal window) ?
> 
> Peter-Dalgaards-MacBook-Air:STAT pd$ ping localhost
> PING localhost (127.0.0.1): 56 data bytes
> Request timeout for icmp_seq 0
> Request timeout for icmp_seq 1
> ^C
> --- localhost ping statistics ---
> 3 packets transmitted, 0 packets received, 100.0% packet loss
> 
> If not, what is in the first couple of lines in /etc/hosts?
> 
> -pd
> 
>> On 19 Oct 2018, at 00:09 , Ben Tupper  wrote:
>> 
>> Just a little followup.  Switching the default browser from Firefox to 
>> Safari yields a similar message in the browser after...
>> 
>> Browse[2]> browseURL(x)
>> 
>> 'Safari can't open the page "localhost:29682/library/utils/html/help.html"
>> because Safari can't find the server "localhost".'
>> 
> 
> -- 
> 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
> 
> 
> 
> 
> 
> 
> 
> 
> 

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/






[[alternative HTML version deleted]]

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Ugggh

I was fully expecting it to fail, given my presumptive new found wisdom...

Had it failed, then it would support the notion that R,app was irrelevant to 
the underlying issue with help and there was something going on with the server 
itself.

However, this now suggests (back to my original view), that there is something 
different in the manner in which R.app displays HTML help content in the 
built-in  browser window.

Did you try to set the help browser in R.app to use an external viewer using 
the command line invocation that I sent earlier?

That is, with R.app not running, in a terminal type:

  defaults write org.R-project.R use.external.help YES

Then run R.app and see what happens with ?plot.

To return R.app to use the default internal browser, close R.app and then in a 
terminal, type:

  defaults delete org.R-project.R use.external.help 




> On Oct 18, 2018, at 6:13 PM, Ben Tupper  wrote:
> 
> Hi,
> 
> ben@gale ~ $ R
> 
> R version 3.5.1 (2018-07-02) -- "Feather Spray"
> 
> 
> > options(help_type = "html")
> > ?plot
> starting httpd help server ... done
> 
> 
> That brings up visible help in the default browser (Safari or Firefox 
> depending upon which is set to be the default browser).
> 
> 
>> On Oct 18, 2018, at 6:04 PM, Marc Schwartz > > wrote:
>> 
>> Hi Ben,
>> 
>> Ok, thanks for that clarification. That fundamentally alters my view of the 
>> issue.
>> 
>> For verification, can you start R in a terminal and then type:
>> 
>>  options(help_type = "html")
>> 
>> after which, then try help for some function (e.g. ?plot) and see what 
>> happens.
>> 
>> Thanks,
>> 
>> Marc
>> 
>> 
>>> On Oct 18, 2018, at 5:45 PM, Ben Tupper >> > wrote:
>>> 
>>> You are correct that it only comes up in the text pager when I invoke R 
>>> from the terminal (with or without --vanilla).
>>> 
>>> RStudio help works as expected in the sense that help content is rendered 
>>> within the RStudio panes on the "Help" tab - just as you surmised.
>>> 
>>> Cheers (really!),
>>> Ben
>>> 
 On Oct 18, 2018, at 5:32 PM, Marc Schwartz >>> > wrote:
 
 Hi Ben,
 
 A question, because as I go back and re-read both this thread and the 
 prior one you posted on this issue, I have been presuming that when you 
 run R from the terminal, you can successfully get help to open in an 
 external browser.
 
 However, given my re-read and what you now post below, I am wondering if, 
 in fact, when running R in the terminal, you simply get the help 
 displaying in the text pager.
 
 I don't use RStudio, so not sure if help comes up in their own internal 
 browser, or if it comes up in an external browser. Albeit, looking at 
 their website, it appears to be an internal browser that stays within the 
 IDE, in contrast to R.app opening the internal browser in an external 
 window.
 
 Can you confirm that when you run R from the terminal, does help appear 
 within the terminal window in the pager, or does it come up in whatever 
 external browser you are using, which I am guessing is Firefox based upon 
 the output below.
 
 Thanks,
 
 Marc
 
 
 
> On Oct 18, 2018, at 5:09 PM, Ben Tupper  > wrote:
> 
> Hi,
> 
> In a fresh R.app session
> 
>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>> help('help')
> starting httpd help server ... done
> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
> debug: {
>  x <- gsub("http://127.0.0.1 ", "http://localhost 
> ", x, fixed = TRUE)
>  .Call("aqua.custom.print", "help-files", x)
>  invisible(x)
> }
> Browse[2]> n
> debug: x <- gsub("http://127.0.0.1 ", 
> "http://localhost ", x, fixed = TRUE)
> Browse[2]> n
> debug: .Call("aqua.custom.print", "help-files", x)
> Browse[2]> browseURL(x)
> 
> 
> opens the external browser 
> http://localhost:28450/library/utils/html/help.html
>  
> 
> 
> but the browser says...
> 
> "Hmm. We’re having trouble finding that site.
> We can’t connect to the server at localhost.
> If that address is correct, here are three other things you can try:
> 
>  Try again later.
>  Check your network connection.
>  If you are connected but behind a firewall, check that Firefox has 
> permission to access the Web."
> 
> 
> And...
> 
> Browse[2]> c
> exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
> 
> ... opens the blank help window.
> 
> 
> Finally, 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Duncan Murdoch

On 18/10/2018 5:09 PM, Ben Tupper wrote:

Hi,

In a fresh R.app session

 > debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
 > help('help')
starting httpd help server ... done
debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
debug: {
     x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
     .Call("aqua.custom.print", "help-files", x)
     invisible(x)
}
Browse[2]> n
debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
Browse[2]> n
debug: .Call("aqua.custom.print", "help-files", x)
Browse[2]> browseURL(x)


opens the external browser 
http://localhost:28450/library/utils/html/help.html


but the browser says...

"Hmm. We’re having trouble finding that site.
We can’t connect to the server at localhost.
If that address is correct, here are three other things you can try:

     Try again later.
     Check your network connection.
     If you are connected but behind a firewall, check that Firefox has 
permission to access the Web."



And...

Browse[2]> c
exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)

... opens the blank help window.


That's the issue then.  Your system doesn't support "localhost", and 
R.app assumes it will.


I don't know enough about MacOS to guess a cause or a remedy, but that's 
what you need to fix.


Duncan Murdoch




Finally, following up on Marc's suggestion that I invoke R without 
--vanilla...


ben@gale ~ $ diff R-app-options R-options
81c81
< 
---
 > 
108,110d107
< $help_type
< [1] "html"
<
184,185c181,182
<                             CRAN
< "http://cran.utstat.utoronto.ca;
---
 >     CRAN
 > "@CRAN@"
247c244
< [1] 168
---
 > [1] 80







On Oct 18, 2018, at 4:49 PM, Duncan Murdoch > wrote:


On 18/10/2018 8:50 AM, Ben Tupper wrote:
I also have no firewall running on the platform.  I do have 
anti-virus/malware and have turned it off.  The help window still 
renders with a blank page and there is no text captured with a 
copy-paste.
I tried debug() as Duncan suggested and get the following in a fresh 
R.app session...


Okay, that wasn't as informative as I had hoped.  Could you try the 
following:


debug(get("aqua.browser", envir = as.environment("tools:RGUI")))

then ask for help on something.  You should stop in the debugger 
seeing something like


debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
debug: {
   x <- gsub("http://127.0.0.1 ", "http://localhost 
", x, fixed = TRUE)

   .Call("aqua.custom.print", "help-files", x)
   invisible(x)
}

At the prompt, type "n" (without the quotes, followed by return) 
twice, until you are at the .Call line.  Then type


browseURL(x)

This should open your external browser.  It will either show a blank 
page, or the help page:  that will indicate whether the problem is in 
the internal browser or in the server.


Then go back to R.app, and type "c".  This should open the same help 
page in the internal browser.  It might show a blank page, or the 
regular help page:  either one would tell us something.


Duncan Murdoch


debug(utils:::print.help_files_with_topic)
help("help")

debugging in: print.help_files_with_topic(x)
debug: {
browser <- getOption("browser")
topic <- attr(x, "topic")
type <- attr(x, "type")
if (.Platform$GUI == "AQUA" && type == "html")
browser <- get("aqua.browser", envir = 
as.environment("tools:RGUI"))

paths <- as.character(x)
if (!length(paths)) {
writeLines(c(gettextf("No documentation for %s in specified 
packages and libraries:",
sQuote(topic)), gettextf("you could try %s", 
sQuote(paste0("??",

topic)
return(invisible(x))
}
port <- if (type == "html")
tools::startDynamicHelp(NA)
else NULL
if (attr(x, "tried_all_packages")) {
paths <- unique(dirname(dirname(paths)))
msg <- gettextf("Help for topic %s is not in any loaded 
package but can be found in the following packages:",

sQuote(topic))
if (type == "html" && port > 0L) {
path <- file.path(tempdir(), ".R/doc/html")
dir.create(path, recursive = TRUE, showWarnings = FALSE)
out <- paste0("4.01 Transitional//EN\">\n",
"R: help\n", "http-equiv=\"Content-Type\" content=\"text/html; charset=\"UTF-8\">\n",
"href=\"/doc/html/R.css\">\n",

"\n\n\n")
out <- c(out, "", msg, "")
out <- c(out, "list\">\n",
"\n", "width=\"25%\">PackageLibrary\n")

pkgs <- basename(paths)
links <- paste0("http://127.0.0.1:;, port,
"/library/", pkgs, "/help/", topic, "\">", pkgs,
"")
out <- c(out, paste0("\n",
"", links, "", dirname(paths), 
"\n"))

out <- c(out, "\n\n\n")
writeLines(out, file.path(path, "all.available.html"))

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Oops.  I did not try it but now have.

ben@gale ~ $ defaults write org.R-project.R use.external.help YES

Using a fresh session of R.app 

?plot 

open the external browser with... 

"Hmm. We’re having trouble finding that site.

We can’t connect to the server at localhost.
If that address is correct, here are three other things you can try:

Try again later.
Check your network connection.
If you are connected but behind a firewall, check that Firefox has 
permission to access the Web."


Switching back ...

ben@gale ~ $ defaults delete org.R-project.R use.external.help

and starting a fresh R.app open the blank help window/


> On Oct 18, 2018, at 6:26 PM, Marc Schwartz  wrote:
> 
> Ugggh
> 
> I was fully expecting it to fail, given my presumptive new found wisdom...
> 
> Had it failed, then it would support the notion that R,app was irrelevant to 
> the underlying issue with help and there was something going on with the 
> server itself.
> 
> However, this now suggests (back to my original view), that there is 
> something different in the manner in which R.app displays HTML help content 
> in the built-in  browser window.
> 
> Did you try to set the help browser in R.app to use an external viewer using 
> the command line invocation that I sent earlier?
> 
> That is, with R.app not running, in a terminal type:
> 
>   defaults write org.R-project.R use.external.help YES
> 
> Then run R.app and see what happens with ?plot.
> 
> To return R.app to use the default internal browser, close R.app and then in 
> a terminal, type:
> 
>   defaults delete org.R-project.R use.external.help 
> 
> 
> 
> 
>> On Oct 18, 2018, at 6:13 PM, Ben Tupper > > wrote:
>> 
>> Hi,
>> 
>> ben@gale ~ $ R
>> 
>> R version 3.5.1 (2018-07-02) -- "Feather Spray"
>> 
>> 
>> > options(help_type = "html")
>> > ?plot
>> starting httpd help server ... done
>> 
>> 
>> That brings up visible help in the default browser (Safari or Firefox 
>> depending upon which is set to be the default browser).
>> 
>> 
>>> On Oct 18, 2018, at 6:04 PM, Marc Schwartz >> > wrote:
>>> 
>>> Hi Ben,
>>> 
>>> Ok, thanks for that clarification. That fundamentally alters my view of the 
>>> issue.
>>> 
>>> For verification, can you start R in a terminal and then type:
>>> 
>>>  options(help_type = "html")
>>> 
>>> after which, then try help for some function (e.g. ?plot) and see what 
>>> happens.
>>> 
>>> Thanks,
>>> 
>>> Marc
>>> 
>>> 
 On Oct 18, 2018, at 5:45 PM, Ben Tupper >>> > wrote:
 
 You are correct that it only comes up in the text pager when I invoke R 
 from the terminal (with or without --vanilla).
 
 RStudio help works as expected in the sense that help content is rendered 
 within the RStudio panes on the "Help" tab - just as you surmised.
 
 Cheers (really!),
 Ben
 
> On Oct 18, 2018, at 5:32 PM, Marc Schwartz  > wrote:
> 
> Hi Ben,
> 
> A question, because as I go back and re-read both this thread and the 
> prior one you posted on this issue, I have been presuming that when you 
> run R from the terminal, you can successfully get help to open in an 
> external browser.
> 
> However, given my re-read and what you now post below, I am wondering if, 
> in fact, when running R in the terminal, you simply get the help 
> displaying in the text pager.
> 
> I don't use RStudio, so not sure if help comes up in their own internal 
> browser, or if it comes up in an external browser. Albeit, looking at 
> their website, it appears to be an internal browser that stays within the 
> IDE, in contrast to R.app opening the internal browser in an external 
> window.
> 
> Can you confirm that when you run R from the terminal, does help appear 
> within the terminal window in the pager, or does it come up in whatever 
> external browser you are using, which I am guessing is Firefox based upon 
> the output below.
> 
> Thanks,
> 
> Marc
> 
> 
> 
>> On Oct 18, 2018, at 5:09 PM, Ben Tupper > > wrote:
>> 
>> Hi,
>> 
>> In a fresh R.app session
>> 
>>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>>> help('help')
>> starting httpd help server ... done
>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>> debug: {
>>  x <- gsub("http://127.0.0.1 ", "http://localhost 
>> ", x, fixed = TRUE)
>>  .Call("aqua.custom.print", "help-files", x)
>>  invisible(x)
>> }
>> Browse[2]> n
>> debug: x <- gsub("http://127.0.0.1 ", 
>> "http://localhost ", x, fixed = TRUE)
>> Browse[2]> n
>> debug: .Call("aqua.custom.print", "help-files", x)
>> Browse[2]> 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread peter dalgaard
Cannot _find_ localhost?? Can you do this (in a Terminal window) ?

Peter-Dalgaards-MacBook-Air:STAT pd$ ping localhost
PING localhost (127.0.0.1): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
^C
--- localhost ping statistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss

If not, what is in the first couple of lines in /etc/hosts?

-pd

> On 19 Oct 2018, at 00:09 , Ben Tupper  wrote:
> 
> Just a little followup.  Switching the default browser from Firefox to Safari 
> yields a similar message in the browser after...
> 
> Browse[2]> browseURL(x)
> 
> 'Safari can't open the page "localhost:29682/library/utils/html/help.html"
> because Safari can't find the server "localhost".'
> 

-- 
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

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Hi,

ben@gale ~ $ R

R version 3.5.1 (2018-07-02) -- "Feather Spray"


> options(help_type = "html")
> ?plot
starting httpd help server ... done


That brings up visible help in the default browser (Safari or Firefox depending 
upon which is set to be the default browser).


> On Oct 18, 2018, at 6:04 PM, Marc Schwartz  wrote:
> 
> Hi Ben,
> 
> Ok, thanks for that clarification. That fundamentally alters my view of the 
> issue.
> 
> For verification, can you start R in a terminal and then type:
> 
>  options(help_type = "html")
> 
> after which, then try help for some function (e.g. ?plot) and see what 
> happens.
> 
> Thanks,
> 
> Marc
> 
> 
>> On Oct 18, 2018, at 5:45 PM, Ben Tupper  wrote:
>> 
>> You are correct that it only comes up in the text pager when I invoke R from 
>> the terminal (with or without --vanilla).
>> 
>> RStudio help works as expected in the sense that help content is rendered 
>> within the RStudio panes on the "Help" tab - just as you surmised.
>> 
>> Cheers (really!),
>> Ben
>> 
>>> On Oct 18, 2018, at 5:32 PM, Marc Schwartz  wrote:
>>> 
>>> Hi Ben,
>>> 
>>> A question, because as I go back and re-read both this thread and the prior 
>>> one you posted on this issue, I have been presuming that when you run R 
>>> from the terminal, you can successfully get help to open in an external 
>>> browser.
>>> 
>>> However, given my re-read and what you now post below, I am wondering if, 
>>> in fact, when running R in the terminal, you simply get the help displaying 
>>> in the text pager.
>>> 
>>> I don't use RStudio, so not sure if help comes up in their own internal 
>>> browser, or if it comes up in an external browser. Albeit, looking at their 
>>> website, it appears to be an internal browser that stays within the IDE, in 
>>> contrast to R.app opening the internal browser in an external window.
>>> 
>>> Can you confirm that when you run R from the terminal, does help appear 
>>> within the terminal window in the pager, or does it come up in whatever 
>>> external browser you are using, which I am guessing is Firefox based upon 
>>> the output below.
>>> 
>>> Thanks,
>>> 
>>> Marc
>>> 
>>> 
>>> 
 On Oct 18, 2018, at 5:09 PM, Ben Tupper  wrote:
 
 Hi,
 
 In a fresh R.app session
 
> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
> help('help')
 starting httpd help server ... done
 debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
 debug: {
  x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
  .Call("aqua.custom.print", "help-files", x)
  invisible(x)
 }
 Browse[2]> n
 debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
 Browse[2]> n
 debug: .Call("aqua.custom.print", "help-files", x)
 Browse[2]> browseURL(x)
 
 
 opens the external browser 
 http://localhost:28450/library/utils/html/help.html
 
 but the browser says...
 
 "Hmm. We’re having trouble finding that site.
 We can’t connect to the server at localhost.
 If that address is correct, here are three other things you can try:
 
  Try again later.
  Check your network connection.
  If you are connected but behind a firewall, check that Firefox has 
 permission to access the Web."
 
 
 And...
 
 Browse[2]> c
 exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
 
 ... opens the blank help window.
 
 
 Finally, following up on Marc's suggestion that I invoke R without 
 --vanilla...
 
 ben@gale ~ $ diff R-app-options R-options 
 81c81
 < 
 ---
> 
 108,110d107
 < $help_type
 < [1] "html"
 < 
 184,185c181,182
 < CRAN 
 < "http://cran.utstat.utoronto.ca; 
 ---
>  CRAN 
> "@CRAN@" 
 247c244
 < [1] 168
 ---
> [1] 80
 
 
 
 
 
 
 
> On Oct 18, 2018, at 4:49 PM, Duncan Murdoch  
> wrote:
> 
> On 18/10/2018 8:50 AM, Ben Tupper wrote:
>> I also have no firewall running on the platform.  I do have 
>> anti-virus/malware and have turned it off.  The help window still 
>> renders with a blank page and there is no text captured with a 
>> copy-paste.
>> I tried debug() as Duncan suggested and get the following in a fresh 
>> R.app session...
> 
> Okay, that wasn't as informative as I had hoped.  Could you try the 
> following:
> 
> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
> 
> then ask for help on something.  You should stop in the debugger seeing 
> something like
> 
> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
> debug: {
> x <- gsub("http://127.0.0.1 ", "http://localhost 
> ", x, fixed = TRUE)
> 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Just a little followup.  Switching the default browser from Firefox to Safari 
yields a similar message in the browser after...

Browse[2]> browseURL(x)

'Safari can't open the page "localhost:29682/library/utils/html/help.html"
because Safari can't find the server "localhost".'
 


> On Oct 18, 2018, at 5:09 PM, Ben Tupper  wrote:
> 
> Hi,
> 
> In a fresh R.app session
> 
> > debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
> > help('help')
> starting httpd help server ... done
> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
> debug: {
> x <- gsub("http://127.0.0.1 ", "http://localhost 
> ", x, fixed = TRUE)
> .Call("aqua.custom.print", "help-files", x)
> invisible(x)
> }
> Browse[2]> n
> debug: x <- gsub("http://127.0.0.1 ", "http://localhost 
> ", x, fixed = TRUE)
> Browse[2]> n
> debug: .Call("aqua.custom.print", "help-files", x)
> Browse[2]> browseURL(x)
> 
> 
> opens the external browser 
> http://localhost:28450/library/utils/html/help.html 
> 
> 
> but the browser says...
> 
> "Hmm. We’re having trouble finding that site.
> We can’t connect to the server at localhost.
> If that address is correct, here are three other things you can try:
> 
> Try again later.
> Check your network connection.
> If you are connected but behind a firewall, check that Firefox has 
> permission to access the Web."
> 
> 
> And...
> 
> Browse[2]> c
> exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
> 
> ... opens the blank help window.
> 
> 
> Finally, following up on Marc's suggestion that I invoke R without 
> --vanilla...
> 
> ben@gale ~ $ diff R-app-options R-options 
> 81c81
> < 
> ---
> > 
> 108,110d107
> < $help_type
> < [1] "html"
> < 
> 184,185c181,182
> < CRAN 
> < "http://cran.utstat.utoronto.ca " 
> ---
> > CRAN 
> > "@CRAN@" 
> 247c244
> < [1] 168
> ---
> > [1] 80
> 
> 
> 
> 
> 
> 
> 
>> On Oct 18, 2018, at 4:49 PM, Duncan Murdoch > > wrote:
>> 
>> On 18/10/2018 8:50 AM, Ben Tupper wrote:
>>> I also have no firewall running on the platform.  I do have 
>>> anti-virus/malware and have turned it off.  The help window still renders 
>>> with a blank page and there is no text captured with a copy-paste.
>>> I tried debug() as Duncan suggested and get the following in a fresh R.app 
>>> session...
>> 
>> Okay, that wasn't as informative as I had hoped.  Could you try the 
>> following:
>> 
>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>> 
>> then ask for help on something.  You should stop in the debugger seeing 
>> something like
>> 
>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>> debug: {
>>x <- gsub("http://127.0.0.1 ", "http://localhost 
>> ", x, fixed = TRUE)
>>.Call("aqua.custom.print", "help-files", x)
>>invisible(x)
>> }
>> 
>> At the prompt, type "n" (without the quotes, followed by return) twice, 
>> until you are at the .Call line.  Then type
>> 
>> browseURL(x)
>> 
>> This should open your external browser.  It will either show a blank page, 
>> or the help page:  that will indicate whether the problem is in the internal 
>> browser or in the server.
>> 
>> Then go back to R.app, and type "c".  This should open the same help page in 
>> the internal browser.  It might show a blank page, or the regular help page: 
>>  either one would tell us something.
>> 
>> Duncan Murdoch
>> 
 debug(utils:::print.help_files_with_topic)
 help("help")
>>> debugging in: print.help_files_with_topic(x)
>>> debug: {
>>> browser <- getOption("browser")
>>> topic <- attr(x, "topic")
>>> type <- attr(x, "type")
>>> if (.Platform$GUI == "AQUA" && type == "html")
>>> browser <- get("aqua.browser", envir = as.environment("tools:RGUI"))
>>> paths <- as.character(x)
>>> if (!length(paths)) {
>>> writeLines(c(gettextf("No documentation for %s in specified 
>>> packages and libraries:",
>>> sQuote(topic)), gettextf("you could try %s", sQuote(paste0("??",
>>> topic)
>>> return(invisible(x))
>>> }
>>> port <- if (type == "html")
>>> tools::startDynamicHelp(NA)
>>> else NULL
>>> if (attr(x, "tried_all_packages")) {
>>> paths <- unique(dirname(dirname(paths)))
>>> msg <- gettextf("Help for topic %s is not in any loaded package but 
>>> can be found in the following packages:",
>>> sQuote(topic))
>>> if (type == "html" && port > 0L) {
>>> path <- file.path(tempdir(), ".R/doc/html")
>>> dir.create(path, recursive = TRUE, showWarnings = FALSE)
>>> out <- paste0(">> Transitional//EN\">\n",
>>> "R: help\n", ">> http-equiv=\"Content-Type\" 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Hi Ben,

Ok, thanks for that clarification. That fundamentally alters my view of the 
issue.

For verification, can you start R in a terminal and then type:

  options(help_type = "html")

after which, then try help for some function (e.g. ?plot) and see what happens.

Thanks,

Marc


> On Oct 18, 2018, at 5:45 PM, Ben Tupper  wrote:
> 
> You are correct that it only comes up in the text pager when I invoke R from 
> the terminal (with or without --vanilla).
> 
> RStudio help works as expected in the sense that help content is rendered 
> within the RStudio panes on the "Help" tab - just as you surmised.
> 
> Cheers (really!),
> Ben
> 
>> On Oct 18, 2018, at 5:32 PM, Marc Schwartz  wrote:
>> 
>> Hi Ben,
>> 
>> A question, because as I go back and re-read both this thread and the prior 
>> one you posted on this issue, I have been presuming that when you run R from 
>> the terminal, you can successfully get help to open in an external browser.
>> 
>> However, given my re-read and what you now post below, I am wondering if, in 
>> fact, when running R in the terminal, you simply get the help displaying in 
>> the text pager.
>> 
>> I don't use RStudio, so not sure if help comes up in their own internal 
>> browser, or if it comes up in an external browser. Albeit, looking at their 
>> website, it appears to be an internal browser that stays within the IDE, in 
>> contrast to R.app opening the internal browser in an external window.
>> 
>> Can you confirm that when you run R from the terminal, does help appear 
>> within the terminal window in the pager, or does it come up in whatever 
>> external browser you are using, which I am guessing is Firefox based upon 
>> the output below.
>> 
>> Thanks,
>> 
>> Marc
>> 
>> 
>> 
>>> On Oct 18, 2018, at 5:09 PM, Ben Tupper  wrote:
>>> 
>>> Hi,
>>> 
>>> In a fresh R.app session
>>> 
 debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
 help('help')
>>> starting httpd help server ... done
>>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>>> debug: {
>>>   x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
>>>   .Call("aqua.custom.print", "help-files", x)
>>>   invisible(x)
>>> }
>>> Browse[2]> n
>>> debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
>>> Browse[2]> n
>>> debug: .Call("aqua.custom.print", "help-files", x)
>>> Browse[2]> browseURL(x)
>>> 
>>> 
>>> opens the external browser 
>>> http://localhost:28450/library/utils/html/help.html
>>> 
>>> but the browser says...
>>> 
>>> "Hmm. We’re having trouble finding that site.
>>> We can’t connect to the server at localhost.
>>> If that address is correct, here are three other things you can try:
>>> 
>>>   Try again later.
>>>   Check your network connection.
>>>   If you are connected but behind a firewall, check that Firefox has 
>>> permission to access the Web."
>>> 
>>> 
>>> And...
>>> 
>>> Browse[2]> c
>>> exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
>>> 
>>> ... opens the blank help window.
>>> 
>>> 
>>> Finally, following up on Marc's suggestion that I invoke R without 
>>> --vanilla...
>>> 
>>> ben@gale ~ $ diff R-app-options R-options 
>>> 81c81
>>> < 
>>> ---
 
>>> 108,110d107
>>> < $help_type
>>> < [1] "html"
>>> < 
>>> 184,185c181,182
>>> < CRAN 
>>> < "http://cran.utstat.utoronto.ca; 
>>> ---
   CRAN 
 "@CRAN@" 
>>> 247c244
>>> < [1] 168
>>> ---
 [1] 80
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
 On Oct 18, 2018, at 4:49 PM, Duncan Murdoch  
 wrote:
 
 On 18/10/2018 8:50 AM, Ben Tupper wrote:
> I also have no firewall running on the platform.  I do have 
> anti-virus/malware and have turned it off.  The help window still renders 
> with a blank page and there is no text captured with a copy-paste.
> I tried debug() as Duncan suggested and get the following in a fresh 
> R.app session...
 
 Okay, that wasn't as informative as I had hoped.  Could you try the 
 following:
 
 debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
 
 then ask for help on something.  You should stop in the debugger seeing 
 something like
 
 debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
 debug: {
  x <- gsub("http://127.0.0.1 ", "http://localhost 
 ", x, fixed = TRUE)
  .Call("aqua.custom.print", "help-files", x)
  invisible(x)
 }
 
 At the prompt, type "n" (without the quotes, followed by return) twice, 
 until you are at the .Call line.  Then type
 
 browseURL(x)
 
 This should open your external browser.  It will either show a blank page, 
 or the help page:  that will indicate whether the problem is in the 
 internal browser or in the server.
 
 Then go back to R.app, and type "c".  This should open the same help page 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
You are correct that it only comes up in the text pager when I invoke R from 
the terminal (with or without --vanilla).

RStudio help works as expected in the sense that help content is rendered 
within the RStudio panes on the "Help" tab - just as you surmised.

Cheers (really!),
Ben

> On Oct 18, 2018, at 5:32 PM, Marc Schwartz  wrote:
> 
> Hi Ben,
> 
> A question, because as I go back and re-read both this thread and the prior 
> one you posted on this issue, I have been presuming that when you run R from 
> the terminal, you can successfully get help to open in an external browser.
> 
> However, given my re-read and what you now post below, I am wondering if, in 
> fact, when running R in the terminal, you simply get the help displaying in 
> the text pager.
> 
> I don't use RStudio, so not sure if help comes up in their own internal 
> browser, or if it comes up in an external browser. Albeit, looking at their 
> website, it appears to be an internal browser that stays within the IDE, in 
> contrast to R.app opening the internal browser in an external window.
> 
> Can you confirm that when you run R from the terminal, does help appear 
> within the terminal window in the pager, or does it come up in whatever 
> external browser you are using, which I am guessing is Firefox based upon the 
> output below.
> 
> Thanks,
> 
> Marc
> 
> 
> 
>> On Oct 18, 2018, at 5:09 PM, Ben Tupper > > wrote:
>> 
>> Hi,
>> 
>> In a fresh R.app session
>> 
>>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>>> help('help')
>> starting httpd help server ... done
>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>> debug: {
>>   x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
>>   .Call("aqua.custom.print", "help-files", x)
>>   invisible(x)
>> }
>> Browse[2]> n
>> debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
>> Browse[2]> n
>> debug: .Call("aqua.custom.print", "help-files", x)
>> Browse[2]> browseURL(x)
>> 
>> 
>> opens the external browser 
>> http://localhost:28450/library/utils/html/help.html 
>> >  >
>> 
>> but the browser says...
>> 
>> "Hmm. We’re having trouble finding that site.
>> We can’t connect to the server at localhost.
>> If that address is correct, here are three other things you can try:
>> 
>>   Try again later.
>>   Check your network connection.
>>   If you are connected but behind a firewall, check that Firefox has 
>> permission to access the Web."
>> 
>> 
>> And...
>> 
>> Browse[2]> c
>> exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
>> 
>> ... opens the blank help window.
>> 
>> 
>> Finally, following up on Marc's suggestion that I invoke R without 
>> --vanilla...
>> 
>> ben@gale ~ $ diff R-app-options R-options 
>> 81c81
>> < 
>> ---
>>> 
>> 108,110d107
>> < $help_type
>> < [1] "html"
>> < 
>> 184,185c181,182
>> < CRAN 
>> < "http://cran.utstat.utoronto.ca " 
>> ---
>>>   CRAN 
>>> "@CRAN@" 
>> 247c244
>> < [1] 168
>> ---
>>> [1] 80
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> On Oct 18, 2018, at 4:49 PM, Duncan Murdoch >> > wrote:
>>> 
>>> On 18/10/2018 8:50 AM, Ben Tupper wrote:
 I also have no firewall running on the platform.  I do have 
 anti-virus/malware and have turned it off.  The help window still renders 
 with a blank page and there is no text captured with a copy-paste.
 I tried debug() as Duncan suggested and get the following in a fresh R.app 
 session...
>>> 
>>> Okay, that wasn't as informative as I had hoped.  Could you try the 
>>> following:
>>> 
>>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>>> 
>>> then ask for help on something.  You should stop in the debugger seeing 
>>> something like
>>> 
>>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>>> debug: {
>>>  x <- gsub("http://127.0.0.1  >> >", "http://localhost  
>>> >", x, fixed = TRUE)
>>>  .Call("aqua.custom.print", "help-files", x)
>>>  invisible(x)
>>> }
>>> 
>>> At the prompt, type "n" (without the quotes, followed by return) twice, 
>>> until you are at the .Call line.  Then type
>>> 
>>> browseURL(x)
>>> 
>>> This should open your external browser.  It will either show a blank page, 
>>> or the help page:  that will indicate whether the problem is in the 
>>> internal browser or in the server.
>>> 
>>> Then go back to R.app, and type "c".  This should open the same help page 
>>> in the internal browser.  It might show a blank page, or the regular help 
>>> page:  either one would tell us something.
>>> 
>>> Duncan Murdoch
>>> 
> 
> 

Ben Tupper
Bigelow Laboratory for 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Hi Ben,

A question, because as I go back and re-read both this thread and the prior one 
you posted on this issue, I have been presuming that when you run R from the 
terminal, you can successfully get help to open in an external browser.

However, given my re-read and what you now post below, I am wondering if, in 
fact, when running R in the terminal, you simply get the help displaying in the 
text pager.

I don't use RStudio, so not sure if help comes up in their own internal 
browser, or if it comes up in an external browser. Albeit, looking at their 
website, it appears to be an internal browser that stays within the IDE, in 
contrast to R.app opening the internal browser in an external window.

Can you confirm that when you run R from the terminal, does help appear within 
the terminal window in the pager, or does it come up in whatever external 
browser you are using, which I am guessing is Firefox based upon the output 
below.

Thanks,

Marc



> On Oct 18, 2018, at 5:09 PM, Ben Tupper  wrote:
> 
> Hi,
> 
> In a fresh R.app session
> 
>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>> help('help')
> starting httpd help server ... done
> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
> debug: {
>x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
>.Call("aqua.custom.print", "help-files", x)
>invisible(x)
> }
> Browse[2]> n
> debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
> Browse[2]> n
> debug: .Call("aqua.custom.print", "help-files", x)
> Browse[2]> browseURL(x)
> 
> 
> opens the external browser 
> http://localhost:28450/library/utils/html/help.html 
> 
> 
> but the browser says...
> 
> "Hmm. We’re having trouble finding that site.
> We can’t connect to the server at localhost.
> If that address is correct, here are three other things you can try:
> 
>Try again later.
>Check your network connection.
>If you are connected but behind a firewall, check that Firefox has 
> permission to access the Web."
> 
> 
> And...
> 
> Browse[2]> c
> exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)
> 
> ... opens the blank help window.
> 
> 
> Finally, following up on Marc's suggestion that I invoke R without 
> --vanilla...
> 
> ben@gale ~ $ diff R-app-options R-options 
> 81c81
> < 
> ---
>> 
> 108,110d107
> < $help_type
> < [1] "html"
> < 
> 184,185c181,182
> < CRAN 
> < "http://cran.utstat.utoronto.ca; 
> ---
>>CRAN 
>> "@CRAN@" 
> 247c244
> < [1] 168
> ---
>> [1] 80
> 
> 
> 
> 
> 
> 
> 
>> On Oct 18, 2018, at 4:49 PM, Duncan Murdoch  wrote:
>> 
>> On 18/10/2018 8:50 AM, Ben Tupper wrote:
>>> I also have no firewall running on the platform.  I do have 
>>> anti-virus/malware and have turned it off.  The help window still renders 
>>> with a blank page and there is no text captured with a copy-paste.
>>> I tried debug() as Duncan suggested and get the following in a fresh R.app 
>>> session...
>> 
>> Okay, that wasn't as informative as I had hoped.  Could you try the 
>> following:
>> 
>> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
>> 
>> then ask for help on something.  You should stop in the debugger seeing 
>> something like
>> 
>> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
>> debug: {
>>   x <- gsub("http://127.0.0.1 ", "http://localhost 
>> ", x, fixed = TRUE)
>>   .Call("aqua.custom.print", "help-files", x)
>>   invisible(x)
>> }
>> 
>> At the prompt, type "n" (without the quotes, followed by return) twice, 
>> until you are at the .Call line.  Then type
>> 
>> browseURL(x)
>> 
>> This should open your external browser.  It will either show a blank page, 
>> or the help page:  that will indicate whether the problem is in the internal 
>> browser or in the server.
>> 
>> Then go back to R.app, and type "c".  This should open the same help page in 
>> the internal browser.  It might show a blank page, or the regular help page: 
>>  either one would tell us something.
>> 
>> Duncan Murdoch
>> 



___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Hi,

In a fresh R.app session

> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
> help('help')
starting httpd help server ... done
debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
debug: {
x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
.Call("aqua.custom.print", "help-files", x)
invisible(x)
}
Browse[2]> n
debug: x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
Browse[2]> n
debug: .Call("aqua.custom.print", "help-files", x)
Browse[2]> browseURL(x)


opens the external browser http://localhost:28450/library/utils/html/help.html 


but the browser says...

"Hmm. We’re having trouble finding that site.
We can’t connect to the server at localhost.
If that address is correct, here are three other things you can try:

Try again later.
Check your network connection.
If you are connected but behind a firewall, check that Firefox has 
permission to access the Web."


And...

Browse[2]> c
exiting from: browser(if (encodeIfNeeded) URLencode(url) else url)

... opens the blank help window.


Finally, following up on Marc's suggestion that I invoke R without --vanilla...

ben@gale ~ $ diff R-app-options R-options 
81c81
< 
---
> 
108,110d107
< $help_type
< [1] "html"
< 
184,185c181,182
< CRAN 
< "http://cran.utstat.utoronto.ca; 
---
> CRAN 
> "@CRAN@" 
247c244
< [1] 168
---
> [1] 80







> On Oct 18, 2018, at 4:49 PM, Duncan Murdoch  wrote:
> 
> On 18/10/2018 8:50 AM, Ben Tupper wrote:
>> I also have no firewall running on the platform.  I do have 
>> anti-virus/malware and have turned it off.  The help window still renders 
>> with a blank page and there is no text captured with a copy-paste.
>> I tried debug() as Duncan suggested and get the following in a fresh R.app 
>> session...
> 
> Okay, that wasn't as informative as I had hoped.  Could you try the following:
> 
> debug(get("aqua.browser", envir = as.environment("tools:RGUI")))
> 
> then ask for help on something.  You should stop in the debugger seeing 
> something like
> 
> debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
> debug: {
>x <- gsub("http://127.0.0.1 ", "http://localhost 
> ", x, fixed = TRUE)
>.Call("aqua.custom.print", "help-files", x)
>invisible(x)
> }
> 
> At the prompt, type "n" (without the quotes, followed by return) twice, until 
> you are at the .Call line.  Then type
> 
> browseURL(x)
> 
> This should open your external browser.  It will either show a blank page, or 
> the help page:  that will indicate whether the problem is in the internal 
> browser or in the server.
> 
> Then go back to R.app, and type "c".  This should open the same help page in 
> the internal browser.  It might show a blank page, or the regular help page:  
> either one would tell us something.
> 
> Duncan Murdoch
> 
>>> debug(utils:::print.help_files_with_topic)
>>> help("help")
>> debugging in: print.help_files_with_topic(x)
>> debug: {
>> browser <- getOption("browser")
>> topic <- attr(x, "topic")
>> type <- attr(x, "type")
>> if (.Platform$GUI == "AQUA" && type == "html")
>> browser <- get("aqua.browser", envir = as.environment("tools:RGUI"))
>> paths <- as.character(x)
>> if (!length(paths)) {
>> writeLines(c(gettextf("No documentation for %s in specified packages 
>> and libraries:",
>> sQuote(topic)), gettextf("you could try %s", sQuote(paste0("??",
>> topic)
>> return(invisible(x))
>> }
>> port <- if (type == "html")
>> tools::startDynamicHelp(NA)
>> else NULL
>> if (attr(x, "tried_all_packages")) {
>> paths <- unique(dirname(dirname(paths)))
>> msg <- gettextf("Help for topic %s is not in any loaded package but 
>> can be found in the following packages:",
>> sQuote(topic))
>> if (type == "html" && port > 0L) {
>> path <- file.path(tempdir(), ".R/doc/html")
>> dir.create(path, recursive = TRUE, showWarnings = FALSE)
>> out <- paste0("> Transitional//EN\">\n",
>> "R: help\n", "> http-equiv=\"Content-Type\" content=\"text/html; charset=\"UTF-8\">\n",
>> "> href=\"/doc/html/R.css\">\n",
>> "\n\n\n")
>> out <- c(out, "", msg, "")
>> out <- c(out, "> list\">\n",
>> "\n", "> width=\"25%\">PackageLibrary\n")
>> pkgs <- basename(paths)
>> links <- paste0("http://127.0.0.1:;, port,
>> "/library/", pkgs, "/help/", topic, "\">", pkgs,
>> "")
>> out <- c(out, paste0("\n",
>> "", links, "", dirname(paths), "\n"))
>> out <- c(out, "\n\n\n")
>> writeLines(out, file.path(path, "all.available.html"))
>> browseURL(paste0("http://127.0.0.1:;, port, 
>> 

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Duncan Murdoch

On 18/10/2018 8:50 AM, Ben Tupper wrote:

I also have no firewall running on the platform.  I do have anti-virus/malware 
and have turned it off.  The help window still renders with a blank page and 
there is no text captured with a copy-paste.

I tried debug() as Duncan suggested and get the following in a fresh R.app 
session...


Okay, that wasn't as informative as I had hoped.  Could you try the 
following:


debug(get("aqua.browser", envir = as.environment("tools:RGUI")))

then ask for help on something.  You should stop in the debugger seeing 
something like


debugging in: browser(if (encodeIfNeeded) URLencode(url) else url)
debug: {
x <- gsub("http://127.0.0.1;, "http://localhost;, x, fixed = TRUE)
.Call("aqua.custom.print", "help-files", x)
invisible(x)
}

At the prompt, type "n" (without the quotes, followed by return) twice, 
until you are at the .Call line.  Then type


browseURL(x)

This should open your external browser.  It will either show a blank 
page, or the help page:  that will indicate whether the problem is in 
the internal browser or in the server.


Then go back to R.app, and type "c".  This should open the same help 
page in the internal browser.  It might show a blank page, or the 
regular help page:  either one would tell us something.


Duncan Murdoch





debug(utils:::print.help_files_with_topic)
help("help")

debugging in: print.help_files_with_topic(x)
debug: {
 browser <- getOption("browser")
 topic <- attr(x, "topic")
 type <- attr(x, "type")
 if (.Platform$GUI == "AQUA" && type == "html")
 browser <- get("aqua.browser", envir = as.environment("tools:RGUI"))
 paths <- as.character(x)
 if (!length(paths)) {
 writeLines(c(gettextf("No documentation for %s in specified packages and 
libraries:",
 sQuote(topic)), gettextf("you could try %s", sQuote(paste0("??",
 topic)
 return(invisible(x))
 }
 port <- if (type == "html")
 tools::startDynamicHelp(NA)
 else NULL
 if (attr(x, "tried_all_packages")) {
 paths <- unique(dirname(dirname(paths)))
 msg <- gettextf("Help for topic %s is not in any loaded package but can be 
found in the following packages:",
 sQuote(topic))
 if (type == "html" && port > 0L) {
 path <- file.path(tempdir(), ".R/doc/html")
 dir.create(path, recursive = TRUE, showWarnings = FALSE)
 out <- paste0("\n",
 "R: help\n", "\n",
 "\n",
 "\n\n\n")
 out <- c(out, "", msg, "")
 out <- c(out, "\n",
 "\n", "PackageLibrary\n")
 pkgs <- basename(paths)
 links <- paste0("http://127.0.0.1:;, port,
 "/library/", pkgs, "/help/", topic, "\">", pkgs,
 "")
 out <- c(out, paste0("\n",
 "", links, "", dirname(paths), "\n"))
 out <- c(out, "\n\n\n")
 writeLines(out, file.path(path, "all.available.html"))
 browseURL(paste0("http://127.0.0.1:;, port, 
"/doc/html/all.available.html"),
 browser)
 }
 else {
 writeLines(c(strwrap(msg), "", paste0("  ", 
formatDL(c(gettext("Package"),
 basename(paths)), c(gettext("Library"), dirname(paths)),
 indent = 22
 }
 }
 else {
 if (length(paths) > 1L) {
 if (type == "html" && port > 0L) {
 browseURL(paste0("http://127.0.0.1:;, port, 
"/library/NULL/help/",
   URLencode(topic, reserved = TRUE)), browser)
 return(invisible(x))
 }
 file <- paths[1L]
 p <- paths
 msg <- gettextf("Help on topic %s was found in the following 
packages:",
 sQuote(topic))
 paths <- dirname(dirname(paths))
 txt <- formatDL(c("Package", basename(paths)), c("Library",
 dirname(paths)), indent = 22L)
 writeLines(c(strwrap(msg), "", paste0("  ", txt),
 ""))
 if (interactive()) {
 fp <- file.path(paths, "Meta", "Rd.rds")
 tp <- basename(p)
 titles <- tp
 if (type == "html" || type == "latex")
   tp <- tools::file_path_sans_ext(tp)
 for (i in seq_along(fp)) {
   tmp <- try(readRDS(fp[i]))
   titles[i] <- if (inherits(tmp, "try-error"))
 "unknown title"
   else tmp[tools::file_path_sans_ext(tmp$File) ==
 tp[i], "Title"]
 }
 txt <- paste0(titles, " {", basename(paths),
   "}")
 res <- menu(txt, title = gettext("Choose one"),
   graphics = getOption("menu.graphics"))
 if (res > 0)
   file <- p[res]
   

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Hi Ben,

Ok, if I read correctly, it looks like you must have started R in the terminal 
using 'R --vanilla', based upon the file name below.

In that case, R should bring up help pages in the terminal using the internal 
text pager, as opposed to externally in a browser with HTML.

Start R in the Terminal just using 'R' and see what, if any, differences there 
are in the output of options() in that case.


Grasping at another straw, let's change the default browser in R.app to see if 
using an external browser, instead of the built-in browser, behaves differently.

As it turns out, from discussions some years ago, it is a bit more complex with 
R.app, as it does not honor the usual options() settings.

So, with R.app NOT running, in a terminal, use:

  defaults write org.R-project.R use.external.help YES

and hit enter.

Then, start R.app and try to use help again and see what happens.


To restore the default use of the internal R.app browser, exit R.app and in a 
terminal, use:

  defaults delete org.R-project.R use.external.help 

and hit enter.


See if that does anything.

Marc



> On Oct 18, 2018, at 10:52 AM, Ben Tupper  wrote:
> 
> Hi,
> 
> Thanks for your persistence and kind help.
> 
> (1)  Comparing output of options()
> 
> R.app options() includes 
> 
> $help_type
> [1] "html"
> 
> that terminal R options() does not.  Here's the diff of the two...
> 
> ben@gale ~ $ diff R-vanilla-options R-app-options 
> 81c81
> < 
> ---
> > 
> 107a108,110
> > $help_type
> > [1] "html"
> > 
> 181,182c184,185
> < CRAN 
> < "@CRAN@" 
> ---
> > CRAN 
> > "http://cran.utstat.utoronto.ca; 
> 244c247
> < [1] 80
> ---
> > [1] 168
> 
> 
> (2) Removing ~/Library/Preferences/org.R-project.R.plist
> 
> Starting R.app after removing the plist does not resolve the blank help 
> window (but did restore R.app's factory-default appearance and settings.)
> 
> > help("help")# brings up blank help page
> starting httpd help server ... done 
> 
> 
> 
> 
> 
> 
> 
>> On Oct 18, 2018, at 10:36 AM, Marc Schwartz  wrote:
>> 
>> Hi,
>> 
>> Two things:
>> 
>> 1. Can one or both of you guys check locally on your own computers, to see 
>> if there is any difference between the output of options() in R.app, versus 
>> the output when R is run from a Terminal session. Many elements will not be 
>> germane to this issue, but others might, if there are differences.
>> 
>> Just wondering if some option() is altered from the default and/or causing a 
>> conflict unique to R.app.
>> 
>> 
>> 
>> 2. Exit from R.app so that it is not running.
>> 
>> Then look for the file:
>> 
>>   ~/Library/Preferences/org.R-project.R.plist
>> 
>> From what I can tell, that is the file that stores the default settings and 
>> user specific Preferences configurations for R.app.
>> 
>> With R.app NOT running, delete that file, or drag it to the desktop, if 
>> preferred.
>> 
>> Then start R.app and see what happens with help. The above .plist file, will 
>> be created new, with the new R.app session, so will return to default 
>> settings. Perhaps there is something in there screwing things up.
>> 
>> 
>> Marc
>> 
>> 
>> 
> 
> Ben Tupper
> Bigelow Laboratory for Ocean Sciences
> 60 Bigelow Drive, P.O. Box 380
> East Boothbay, Maine 04544
> http://www.bigelow.org
> 
> Ecological Forecasting: https://eco.bigelow.org/
> 
> 
> 
> 
> 

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
Hi,

Thanks for your persistence and kind help.

(1)  Comparing output of options()

R.app options() includes 

$help_type
[1] "html"

that terminal R options() does not.  Here's the diff of the two...

ben@gale ~ $ diff R-vanilla-options R-app-options 
81c81
< 
---
> 
107a108,110
> $help_type
> [1] "html"
> 
181,182c184,185
< CRAN 
< "@CRAN@" 
---
> CRAN 
> "http://cran.utstat.utoronto.ca; 
244c247
< [1] 80
---
> [1] 168


(2) Removing ~/Library/Preferences/org.R-project.R.plist

Starting R.app after removing the plist does not resolve the blank help window 
(but did restore R.app's factory-default appearance and settings.)

> help("help")  # brings up blank help page
starting httpd help server ... done 







> On Oct 18, 2018, at 10:36 AM, Marc Schwartz  wrote:
> 
> Hi,
> 
> Two things:
> 
> 1. Can one or both of you guys check locally on your own computers, to see if 
> there is any difference between the output of options() in R.app, versus the 
> output when R is run from a Terminal session. Many elements will not be 
> germane to this issue, but others might, if there are differences.
> 
> Just wondering if some option() is altered from the default and/or causing a 
> conflict unique to R.app.
> 
> 
> 
> 2. Exit from R.app so that it is not running.
> 
> Then look for the file:
> 
>   ~/Library/Preferences/org.R-project.R.plist
> 
> From what I can tell, that is the file that stores the default settings and 
> user specific Preferences configurations for R.app.
> 
> With R.app NOT running, delete that file, or drag it to the desktop, if 
> preferred.
> 
> Then start R.app and see what happens with help. The above .plist file, will 
> be created new, with the new R.app session, so will return to default 
> settings. Perhaps there is something in there screwing things up.
> 
> 
> Marc
> 
> 
> 

Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org

Ecological Forecasting: https://eco.bigelow.org/






[[alternative HTML version deleted]]

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Marc Schwartz via R-SIG-Mac
Hi,

Two things:

1. Can one or both of you guys check locally on your own computers, to see if 
there is any difference between the output of options() in R.app, versus the 
output when R is run from a Terminal session. Many elements will not be germane 
to this issue, but others might, if there are differences.

Just wondering if some option() is altered from the default and/or causing a 
conflict unique to R.app.



2. Exit from R.app so that it is not running.

Then look for the file:

  ~/Library/Preferences/org.R-project.R.plist

>From what I can tell, that is the file that stores the default settings and 
>user specific Preferences configurations for R.app.

With R.app NOT running, delete that file, or drag it to the desktop, if 
preferred.

Then start R.app and see what happens with help. The above .plist file, will be 
created new, with the new R.app session, so will return to default settings. 
Perhaps there is something in there screwing things up.


Marc




[[alternative HTML version deleted]]

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac


Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread Ben Tupper
I also have no firewall running on the platform.  I do have anti-virus/malware 
and have turned it off.  The help window still renders with a blank page and 
there is no text captured with a copy-paste.

I tried debug() as Duncan suggested and get the following in a fresh R.app 
session...


> debug(utils:::print.help_files_with_topic)
> help("help")
debugging in: print.help_files_with_topic(x)
debug: {
browser <- getOption("browser")
topic <- attr(x, "topic")
type <- attr(x, "type")
if (.Platform$GUI == "AQUA" && type == "html") 
browser <- get("aqua.browser", envir = as.environment("tools:RGUI"))
paths <- as.character(x)
if (!length(paths)) {
writeLines(c(gettextf("No documentation for %s in specified packages 
and libraries:", 
sQuote(topic)), gettextf("you could try %s", sQuote(paste0("??", 
topic)
return(invisible(x))
}
port <- if (type == "html") 
tools::startDynamicHelp(NA)
else NULL
if (attr(x, "tried_all_packages")) {
paths <- unique(dirname(dirname(paths)))
msg <- gettextf("Help for topic %s is not in any loaded package but can 
be found in the following packages:", 
sQuote(topic))
if (type == "html" && port > 0L) {
path <- file.path(tempdir(), ".R/doc/html")
dir.create(path, recursive = TRUE, showWarnings = FALSE)
out <- paste0("\n", 
"R: help\n", "\n", 
"\n", 
"\n\n\n")
out <- c(out, "", msg, "")
out <- c(out, "\n", 
"\n", "PackageLibrary\n")
pkgs <- basename(paths)
links <- paste0("http://127.0.0.1:;, port, 
"/library/", pkgs, "/help/", topic, "\">", pkgs, 
"")
out <- c(out, paste0("\n", 
"", links, "", dirname(paths), "\n"))
out <- c(out, "\n\n\n")
writeLines(out, file.path(path, "all.available.html"))
browseURL(paste0("http://127.0.0.1:;, port, 
"/doc/html/all.available.html"), 
browser)
}
else {
writeLines(c(strwrap(msg), "", paste0("  ", 
formatDL(c(gettext("Package"), 
basename(paths)), c(gettext("Library"), dirname(paths)), 
indent = 22
}
}
else {
if (length(paths) > 1L) {
if (type == "html" && port > 0L) {
browseURL(paste0("http://127.0.0.1:;, port, 
"/library/NULL/help/", 
  URLencode(topic, reserved = TRUE)), browser)
return(invisible(x))
}
file <- paths[1L]
p <- paths
msg <- gettextf("Help on topic %s was found in the following 
packages:", 
sQuote(topic))
paths <- dirname(dirname(paths))
txt <- formatDL(c("Package", basename(paths)), c("Library", 
dirname(paths)), indent = 22L)
writeLines(c(strwrap(msg), "", paste0("  ", txt), 
""))
if (interactive()) {
fp <- file.path(paths, "Meta", "Rd.rds")
tp <- basename(p)
titles <- tp
if (type == "html" || type == "latex") 
  tp <- tools::file_path_sans_ext(tp)
for (i in seq_along(fp)) {
  tmp <- try(readRDS(fp[i]))
  titles[i] <- if (inherits(tmp, "try-error")) 
"unknown title"
  else tmp[tools::file_path_sans_ext(tmp$File) == 
tp[i], "Title"]
}
txt <- paste0(titles, " {", basename(paths), 
  "}")
res <- menu(txt, title = gettext("Choose one"), 
  graphics = getOption("menu.graphics"))
if (res > 0) 
  file <- p[res]
}
else {
writeLines(gettext("\nUsing the first match ..."))
}
}
else file <- paths
if (type == "html") {
if (port > 0L) {
path <- dirname(file)
dirpath <- dirname(path)
pkgname <- basename(dirpath)
browseURL(paste0("http://127.0.0.1:;, port, "/library/", 
  pkgname, "/html/", basename(file), ".html"), 
  browser)
}
else {
warning("HTML help is unavailable", call. = FALSE)
att <- attributes(x)
xx <- sub("/html/([^/]*)\\.html$", "/help/\\1", 
  x)
attributes(xx) <- att
attr(xx, "type") <- "text"
print(xx)
}
}
else if (type == "text") {
pkgname <- basename(dirname(dirname(file)))
temp <- tools::Rd2txt(.getHelpFile(file), out = tempfile("Rtxt"), 
package = pkgname)

Re: [R-SIG-Mac] Blank help window

2018-10-18 Thread zListserv


> On 2018-10-17, at 22:29, Marc Schwartz  wrote:
> 
> Ok, strange. I figured that there was some conflict/corruption in place with 
> R.app that was not immediately clear.
> 
> Peter raised the possibility of a firewall issue, but I am curious as to why 
> that would affect the use of help in R.app, but not via other environments, 
> like the Mac Terminal app. Theoretically, it should be via similar protocols 
> and ports in each setting, unless there is something specific that R.app does 
> to the OS environment when running, that would inhibit the dynamic generation 
> of the HTML pages. But if so, why just for the two of you?
> 
> It seems like the server is starting up ok, but the help pages are not being 
> generated by Rd2HTML() in R.app.
> 
> However, it sparked a thought in my head, which is always risky, and that is, 
> do you guys have any anti-virus/malware software running? I may be grasping 
> at straws here, but such applications have been known to cause all kinds of 
> flaky behaviors, that are not immediately evident nor associated with them.

No firewall; no anti-virus or other malware software

> 
> One other thought. When you get the blank HTML page, presumably white 
> background, drag the cursor around the page to try to highlight text, as if 
> the text was also white, thus not showing against the white background. 
> Another straw

Nope.  Blank is blank.  No invisible text detected.

> 
> Regards,
> 
> Marc
> 

___
R-SIG-Mac mailing list
R-SIG-Mac@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-mac