Re: [R] How to start default browser on R

2010-11-24 Thread Gavin Simpson
On Mon, 2010-11-22 at 23:31 -0800, Stephen Liu wrote:
> Hi David,
> 
> I see.  File: gives the full path to the .html file created/download.  Then 
> the 
> browser will open that file.  Thanks.
> 
> I don't have hwriter package installed.
> 
> A side question, what will be the corresponding command on R for check 
> whether a 
> package already installed?
> 
> similar to;
> On R (Windows)
> Packages - Load package

No, that is a work around that gives the answer you want in a rather
round-about way.

As far as I can see, there isn't one, but it is easy to cook up:

isInstalled <- function(pkg, lib.loc = NULL) {
stopifnot(is.character(pkg))
pkgs <- installed.packages(lib.loc = lib.loc)
pkg %in% pkgs
}

G

> B.R.
> Stephen L
> 
> 
> 
> - Original Message 
> From: David Scott 
> To: Stephen Liu 
> Cc: Ista Zahn ; "r-help@r-project.org" 
> 
> Sent: Tue, November 23, 2010 12:00:36 PM
> Subject: Re: [R] How to start default browser on R
> 
>   On 23/11/10 16:59, Stephen Liu wrote:
> > Hi Ista,
> >
> > I see.  Your advice works.  Thanks
> >
> > even without:
> > browser="C:/Program Files/Internet Explorer/iexplore.exe")
> >
> > For non default browser it needs;
> > browser="C:/Program Files/Mozilla Firefoe/firefox.exe"
> >
> >
> > What will be "file:" used for?
> >
> >
> > B.R.
> > Stephen L
> >
> You can use it to open a local file on your machine as well. I use this 
> all the time with hwriter which writes html reports.
> 
> David Scott
> 

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London  [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

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


Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi David,

I see.  File: gives the full path to the .html file created/download.  Then the 
browser will open that file.  Thanks.

I don't have hwriter package installed.

A side question, what will be the corresponding command on R for check whether 
a 
package already installed?

similar to;
On R (Windows)
Packages - Load package


B.R.
Stephen L



- Original Message 
From: David Scott 
To: Stephen Liu 
Cc: Ista Zahn ; "r-help@r-project.org" 

Sent: Tue, November 23, 2010 12:00:36 PM
Subject: Re: [R] How to start default browser on R

  On 23/11/10 16:59, Stephen Liu wrote:
> Hi Ista,
>
> I see.  Your advice works.  Thanks
>
> even without:
> browser="C:/Program Files/Internet Explorer/iexplore.exe")
>
> For non default browser it needs;
> browser="C:/Program Files/Mozilla Firefoe/firefox.exe"
>
>
> What will be "file:" used for?
>
>
> B.R.
> Stephen L
>
You can use it to open a local file on your machine as well. I use this 
all the time with hwriter which writes html reports.

David Scott

-- 
_
David ScottDepartment of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics



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


Re: [R] How to start default browser on R

2010-11-22 Thread David Scott

 On 23/11/10 16:59, Stephen Liu wrote:

Hi Ista,

I see.  Your advice works.  Thanks

even without:
browser="C:/Program Files/Internet Explorer/iexplore.exe")

For non default browser it needs;
browser="C:/Program Files/Mozilla Firefoe/firefox.exe"


What will be "file:" used for?


B.R.
Stephen L

You can use it to open a local file on your machine as well. I use this 
all the time with hwriter which writes html reports.


David Scott

--
_
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:  d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

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


Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi Ista,

I see.  Your advice works.  Thanks

even without:
browser="C:/Program Files/Internet Explorer/iexplore.exe")

For non default browser it needs;
browser="C:/Program Files/Mozilla Firefoe/firefox.exe"


What will be "file:" used for?


B.R.
Stephen L



- Original Message 
From: Ista Zahn 
To: Stephen Liu 
Cc: David Scott ; "r-help@r-project.org" 

Sent: Tue, November 23, 2010 11:39:15 AM
Subject: Re: [R] How to start default browser on R

Hi Stephen,
I'm not sure if this is the problem, but you almost certainly do not
want the "file:" part. Try

browseURL("http://www.r-project.org";)

-Ista

On Mon, Nov 22, 2010 at 10:26 PM, Stephen Liu  wrote:
> Hi David,
>
> Thanks for your advice.
>
> According to the Example on ?browseURL I tried:
>
> 1)
> browseURL("file:http://www.r-project.org";, browser="C:/Program Files/Internet
> Explorer/iexplore.exe")
>
> It starts a small windows asking for permission to accept ActiveX
> -> OK
>
> IE doesn't start
>
> 2)
> browseURL("file:http://d:/R/R-2.5.1/html/index.html";, browser="C:/Program
> Files/Internet Explorer/iexplore.exe")
>
> same result as 1) above
>
>
> What I have missed?  TIA
>
>
> B.R.
> Stephen L
>
>
>
>
> - Original Message 
> From: David Scott 
> To: Stephen Liu 
> Cc: "r-help@r-project.org" 
> Sent: Tue, November 23, 2010 10:16:04 AM
> Subject: Re: [R] How to start default browser on R
>
>  On 23/11/10 14:20, Stephen Liu wrote:
>> Hi folks,
>>
>> Win7 64 bit
>> IE 64 bit
>>
>> How to start IE on R?  TIA
>>
>> B.R.
>> Stephen L
>>
>>
> ?browseURL
>
> --
> _
> David ScottDepartment of Statistics
>The University of Auckland, PB 92019
>Auckland 1142,NEW ZEALAND
> Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
> Email:d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018
>
> Director of Consulting, Department of Statistics
>
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org




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


Re: [R] How to start default browser on R

2010-11-22 Thread Ista Zahn
Hi Stephen,
I'm not sure if this is the problem, but you almost certainly do not
want the "file:" part. Try

browseURL("http://www.r-project.org";)

-Ista

On Mon, Nov 22, 2010 at 10:26 PM, Stephen Liu  wrote:
> Hi David,
>
> Thanks for your advice.
>
> According to the Example on ?browseURL I tried:
>
> 1)
> browseURL("file:http://www.r-project.org";, browser="C:/Program Files/Internet
> Explorer/iexplore.exe")
>
> It starts a small windows asking for permission to accept ActiveX
> -> OK
>
> IE doesn't start
>
> 2)
> browseURL("file:http://d:/R/R-2.5.1/html/index.html";, browser="C:/Program
> Files/Internet Explorer/iexplore.exe")
>
> same result as 1) above
>
>
> What I have missed?  TIA
>
>
> B.R.
> Stephen L
>
>
>
>
> ----- Original Message ----
> From: David Scott 
> To: Stephen Liu 
> Cc: "r-help@r-project.org" 
> Sent: Tue, November 23, 2010 10:16:04 AM
> Subject: Re: [R] How to start default browser on R
>
>  On 23/11/10 14:20, Stephen Liu wrote:
>> Hi folks,
>>
>> Win7 64 bit
>> IE 64 bit
>>
>> How to start IE on R?  TIA
>>
>> B.R.
>> Stephen L
>>
>>
> ?browseURL
>
> --
> _
> David Scott    Department of Statistics
>        The University of Auckland, PB 92019
>        Auckland 1142,    NEW ZEALAND
> Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
> Email:    d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018
>
> Director of Consulting, Department of Statistics
>
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Ista Zahn
Graduate student
University of Rochester
Department of Clinical and Social Psychology
http://yourpsyche.org

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


Re: [R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi David,

Thanks for your advice.

According to the Example on ?browseURL I tried:

1)
browseURL("file:http://www.r-project.org";, browser="C:/Program Files/Internet 
Explorer/iexplore.exe")

It starts a small windows asking for permission to accept ActiveX
-> OK

IE doesn't start

2)
browseURL("file:http://d:/R/R-2.5.1/html/index.html";, browser="C:/Program 
Files/Internet Explorer/iexplore.exe")

same result as 1) above


What I have missed?  TIA


B.R.
Stephen L




- Original Message 
From: David Scott 
To: Stephen Liu 
Cc: "r-help@r-project.org" 
Sent: Tue, November 23, 2010 10:16:04 AM
Subject: Re: [R] How to start default browser on R

  On 23/11/10 14:20, Stephen Liu wrote:
> Hi folks,
>
> Win7 64 bit
> IE 64 bit
>
> How to start IE on R?  TIA
>
> B.R.
> Stephen L
>
>
?browseURL

-- 
_
David ScottDepartment of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics



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


Re: [R] How to start default browser on R

2010-11-22 Thread David Scott

 On 23/11/10 14:20, Stephen Liu wrote:

Hi folks,

Win7 64 bit
IE 64 bit

How to start IE on R?  TIA

B.R.
Stephen L



?browseURL

--
_
David Scott Department of Statistics
The University of Auckland, PB 92019
Auckland 1142,NEW ZEALAND
Phone: +64 9 923 5055, or +64 9 373 7599 ext 85055
Email:  d.sc...@auckland.ac.nz,  Fax: +64 9 373 7018

Director of Consulting, Department of Statistics

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


[R] How to start default browser on R

2010-11-22 Thread Stephen Liu
Hi folks,

Win7 64 bit
IE 64 bit

How to start IE on R?  TIA

B.R.
Stephen L




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