Getting the contents of a library interactively in R
help(package = packagename)
will list all non-internal functions in a package.
Yes, use ls()
.
You can use search() to see what's in the search path:
> search() [1] ".GlobalEnv" "package:stats" "package:graphics"[4] "package:grDevices" "package:utils" "package:datasets"[7] "package:methods" "Autoloads" "package:base"
You can search a particular package with the full name:
> ls("package:graphics") [1] "abline" "arrows" "assocplot" "axis" ....
I also suggest that you look at this related question on stackoverflow which includes some more creative approaching to browsing the environment. If you're using ESS, then you can use Ess-rdired.
To get the help pages on a particular topic, you can either use help(function.name)
or ?function.name
. You will also find the help.search()
function useful if you don't know the exact function name or package. And lastly, have a look at the sos package.
help(topic) #for documentation on a topic?topicsummary(mydata) #an overview of data objects tryls() # lists all objects in the local namespacestr(object) # structure of an objectls.str() # structure of each object returned by ls()apropos("mytopic") # string search of the documentation
All from the R reference card