open help files from Terminal

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

open help files from Terminal

Dmitri Popavenko
Dear R users,

I am sometimes using R from a Terminal (either from Linux but most often on
MacOS).
When looking at a help file using the question mark (e.g. ?sd) the help
file opens in the Terminal itself.

If possible, I would like to open the HTML version of the help file in a
webpage, but I am completely unaware of how this might be done.

If anyone has a suggestion, I would be very grateful.

Best,
Dmitri

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: open help files from Terminal

David Winsemius

> On Jun 7, 2018, at 8:21 AM, Dmitri Popavenko <[hidden email]> wrote:
>
> Dear R users,
>
> I am sometimes using R from a Terminal (either from Linux but most often on
> MacOS).
> When looking at a help file using the question mark (e.g. ?sd) the help
> file opens in the Terminal itself.
>
> If possible, I would like to open the HTML version of the help file in a
> webpage, but I am completely unaware of how this might be done.

First I looked at:

?help

Seeing the help-type parameter included "html" as a potential value, I therefore tried this from a Terminal-launched session on a Mac (although normally I work in the R.app GUI):

help(sd, help_type="html")

I get the expected sd-help page displayed in my open Chrome browser.


>
> If anyone has a suggestion, I would be very grateful.
>
> Best,
> Dmitri
>
> [[alternative HTML version deleted]]

R is a plain text mailing list.
>
> ______________________________________________
> [hidden email] 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.

David Winsemius
Alameda, CA, USA

'Any technology distinguishable from magic is insufficiently advanced.'   -Gehm's Corollary to Clarke's Third Law

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: open help files from Terminal

Sarah Goslee
In reply to this post by Dmitri Popavenko
Here are two options:

> # for one occurrence
> help("help", help_type="html")
starting httpd help server ... done
>
> # to set the default for your R session
> options(help_type = "html")
> ?help

If you read the help file for help(), you will see all the possibilities.

Sarah

On Thu, Jun 7, 2018 at 11:21 AM, Dmitri Popavenko
<[hidden email]> wrote:

> Dear R users,
>
> I am sometimes using R from a Terminal (either from Linux but most often on
> MacOS).
> When looking at a help file using the question mark (e.g. ?sd) the help
> file opens in the Terminal itself.
>
> If possible, I would like to open the HTML version of the help file in a
> webpage, but I am completely unaware of how this might be done.
>
> If anyone has a suggestion, I would be very grateful.
>
> Best,
> Dmitri

--
Sarah Goslee
http://www.functionaldiversity.org

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: open help files from Terminal

Dmitri Popavenko
Dear Sarah, dear David,

Thank you very much indeed, this is exactly what I needed.

Best,
Dmitri

On Thu, Jun 7, 2018 at 6:39 PM, Sarah Goslee <[hidden email]> wrote:

> Here are two options:
>
> > # for one occurrence
> > help("help", help_type="html")
> starting httpd help server ... done
> >
> > # to set the default for your R session
> > options(help_type = "html")
> > ?help
>
> If you read the help file for help(), you will see all the possibilities.
>
> Sarah
>
> On Thu, Jun 7, 2018 at 11:21 AM, Dmitri Popavenko
> <[hidden email]> wrote:
> > Dear R users,
> >
> > I am sometimes using R from a Terminal (either from Linux but most often
> on
> > MacOS).
> > When looking at a help file using the question mark (e.g. ?sd) the help
> > file opens in the Terminal itself.
> >
> > If possible, I would like to open the HTML version of the help file in a
> > webpage, but I am completely unaware of how this might be done.
> >
> > If anyone has a suggestion, I would be very grateful.
> >
> > Best,
> > Dmitri
>
> --
> Sarah Goslee
> http://www.functionaldiversity.org
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: open help files from Terminal

Alex Zarebski
While we are on the topic, if you wanted to go the other way (open help in
terminal without a whole R session) you can do

R --no-init-file --slave -e "?sd"

I suspect this does start an R session in the background, but makes for a
clean way to view docs through terminal if you use an alias.

Cheers,
Alex

On Fri, Jun 8, 2018 at 1:47 AM, Dmitri Popavenko <[hidden email]
> wrote:

> Dear Sarah, dear David,
>
> Thank you very much indeed, this is exactly what I needed.
>
> Best,
> Dmitri
>
> On Thu, Jun 7, 2018 at 6:39 PM, Sarah Goslee <[hidden email]>
> wrote:
>
> > Here are two options:
> >
> > > # for one occurrence
> > > help("help", help_type="html")
> > starting httpd help server ... done
> > >
> > > # to set the default for your R session
> > > options(help_type = "html")
> > > ?help
> >
> > If you read the help file for help(), you will see all the possibilities.
> >
> > Sarah
> >
> > On Thu, Jun 7, 2018 at 11:21 AM, Dmitri Popavenko
> > <[hidden email]> wrote:
> > > Dear R users,
> > >
> > > I am sometimes using R from a Terminal (either from Linux but most
> often
> > on
> > > MacOS).
> > > When looking at a help file using the question mark (e.g. ?sd) the help
> > > file opens in the Terminal itself.
> > >
> > > If possible, I would like to open the HTML version of the help file in
> a
> > > webpage, but I am completely unaware of how this might be done.
> > >
> > > If anyone has a suggestion, I would be very grateful.
> > >
> > > Best,
> > > Dmitri
> >
> > --
> > Sarah Goslee
> > http://www.functionaldiversity.org
> >
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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]]

______________________________________________
[hidden email] 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.