Steven McKinney
2009-Jul-23 20:30 UTC
[R] Navigate to Index page of a package from R command prompt
Hi all, Is there a way to navigate directly to the "Index" page of help for a package? Here's my connundrum: I download and install package "foo". I don't know what functions are in package "foo", so I can't invoke the help for package "foo" via> ?someFunctionhelp(package = "foo") pops up some non-hyperlinked information page, not package foo's help Index page. If the package author kindly made a "foo" object or function and put that in package "foo", then> ?fooworks and yields a help page for package "foo". Now at the bottom of the help page is a hyperlink "Index" and I can click that to navigate to the main help Index page (the page I really want to get to straight from the R command line). I see that the link to "Index" for package "foo" appears always to be (on my Mac) file:///Library/Frameworks/R.framework/Resources/library/foo/html/00Index.html e.g. file:///Library/Frameworks/R.framework/Resources/library/cmprsk/html/00Index.html file:///Library/Frameworks/R.framework/Resources/library/utils/html/00Index.html Is there a command from the R listener that can take me directly to this "00Index.html" page of help for package "foo"? something like> help("00Index", package = "utils")(but this does not work)? Any info appreciated Best Steven McKinney Statistician Molecular Oncology and Breast Cancer Program British Columbia Cancer Research Centre
Marc Schwartz
2009-Jul-23 21:03 UTC
[R] Navigate to Index page of a package from R command prompt
On Jul 23, 2009, at 3:30 PM, Steven McKinney wrote:> > Hi all, > > Is there a way to navigate directly to the "Index" page of help > for a package? > > Here's my connundrum: > > I download and install package "foo". > I don't know what functions are in package "foo", > so I can't invoke the help for package "foo" via >> ?someFunction > > help(package = "foo") > pops up some non-hyperlinked information page, not > package foo's help Index page. > > If the package author kindly made a "foo" object or function > and put that in package "foo", then >> ?foo > works and yields a help page for package "foo". > Now at the bottom of the help page is a hyperlink "Index" > and I can click that to navigate to the main help Index page > (the page I really want to get to straight from the R > command line). > > I see that the link to "Index" for package "foo" appears always to be > (on my Mac) > file:///Library/Frameworks/R.framework/Resources/library/foo/html/00Index.html > > e.g. > file:///Library/Frameworks/R.framework/Resources/library/cmprsk/html/00Index.html > > file:///Library/Frameworks/R.framework/Resources/library/utils/html/00Index.html > > Is there a command from the R listener that can take me directly to > this "00Index.html" page of help for package "foo"? > > something like >> help("00Index", package = "utils") > > (but this does not work)? > > Any info appreciated > > Best > > Steven McKinneySteven, Once a package has been loaded with 'library(PackageName)', you can use .path.package("PackageName") to get the path to the main package installation folder and then append the remainder: library(survival) > .path.package("survival") [1] "/Library/Frameworks/R.framework/Resources/library/survival" > file.path(.path.package("survival"), "html", "00Index.html") [1] "/Library/Frameworks/R.framework/Resources/library/survival/html/ 00Index.html" See ?.path.package and ?file.path for more information. You can also use .find.package() for unloaded packages and that is described on the same help page as .path.package. Finally, you can use browseURL() to bring the index file up in your browser: browseURL(file.path(.path.package("survival"), "html", "00Index.html")) HTH, Marc Schwartz
Gabor Grothendieck
2009-Jul-23 23:48 UTC
[R] Navigate to Index page of a package from R command prompt
Try enter at the R console: help.start() and then when the help comes up in your browser click on Packages and then click on the package you want and then click on the help file you want On Thu, Jul 23, 2009 at 3:30 PM, Steven McKinney<smckinney at bccrc.ca> wrote:> > Hi all, > > Is there a way to navigate directly to the "Index" page of help > for a package? > > Here's my connundrum: > > I download and install package "foo". > I don't know what functions are in package "foo", > so I can't invoke the help for package "foo" via >> ?someFunction > > help(package = "foo") > pops up some non-hyperlinked information page, not > package foo's help Index page. > > If the package author kindly made a "foo" object or function > and put that in package "foo", then >> ?foo > works and yields a help page for package "foo". > Now at the bottom of the help page is a hyperlink "Index" > and I can click that to navigate to the main help Index page > (the page I really want to get to straight from the R > command line). > > I see that the link to "Index" for package "foo" appears always to be > (on my Mac) > file:///Library/Frameworks/R.framework/Resources/library/foo/html/00Index.html > > e.g. > file:///Library/Frameworks/R.framework/Resources/library/cmprsk/html/00Index.html > > file:///Library/Frameworks/R.framework/Resources/library/utils/html/00Index.html > > Is there a command from the R listener that can take me directly to > this "00Index.html" page of help for package "foo"? > > something like >> help("00Index", package = "utils") > > (but this does not work)? > > Any info appreciated > > Best > > Steven McKinney > > Statistician > Molecular Oncology and Breast Cancer Program > British Columbia Cancer Research Centre > > ______________________________________________ > R-help at 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. >
Maybe Matching Threads
- Wishlist: Navigate to "Index" page of help when no topic (PR#13872)
- Wishlist: Navigate to "Index" page of help when no topic specified (PR#13860)
- Wishlist: Navigate to "Index" page of help when no topic (PR#13871)
- Wishlist: Navigate to "Index" page of help when no topic (PR#13873)
- Wishlist: Navigate to "Index" page of help when no topic (PR#13868)