Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the package when looking up a help reference page for a function?

How does one look up the help manual page for a function and specify the package in R? For example, count appears in both seqinr and plyr. If I want to look up count in plyr, what's the command? I've tried a few obvious (but wrong) guesses such as "?plyr::count"

EDIT: When I do ?count, I get the following message:

Help on topic 'count' was found in the following packages:

  Package               Library
  plyr                  /Library/Frameworks/R.framework/Versions/2.15/Resources/library
  seqinr                /Library/Frameworks/R.framework/Versions/2.15/Resources/library

When I do ?plyr::count, I get:

No documentation for 'plyr::count' in specified packages and libraries:
you could try '??plyr::count'

When I do ?plyr:::count, I get:

No documentation for 'plyr:::count' in specified packages and libraries:
you could try '??plyr:::count'

Adding two question marks also gets me a no documentation found error as well. Looking up help for non-ambiguous funcitons is working fine (e.g. ?plot)

This is with R 2.15.0 on OSX running in emacs + ESS.

like image 420
daj Avatar asked Apr 27 '12 20:04

daj


3 Answers

Use the package= argument to help:

help("count", package="plyr")
like image 111
Joshua Ulrich Avatar answered Sep 30 '22 18:09

Joshua Ulrich


The correct way to do this is:

?plyr::count
?plyr:::count

See ?"?" for details - both examples are shown.

Both work for me with both packages loaded and even without the package loaded. That begs the question if you have the packages installed?

like image 45
Gavin Simpson Avatar answered Sep 30 '22 18:09

Gavin Simpson


You were close, you need three : :::

?seqinr:::count # for seqinr
?plyr:::count # for plyr
like image 22
nograpes Avatar answered Sep 30 '22 18:09

nograpes