about: Get information and help about R objects

View source: R/about.R

aboutR Documentation

Get information and help about R objects

Description

Help obtained with this function is wider than with help(). If a man page is not found, it suggests related topics. If an object is an S3 generic function, it also lists all its known methods. Also, one can track the help page of an object even if its name is changed, by using the src or srcfile attribute of the object's comment. By the way, if the object has a comment, it is also displayed. This can be used as a quick and dirty way to provide short hints to custom objects. Finally, it is possible to track down the source of an object into a file with the srcfile attribute of its comment. In this case, it is the source file that is displayed. So, you can also further document your custom objects easily in their source files!

Usage

about(topic, ...)

`?`(type, topic)

ex()

## S3 method for class 'runnable'
print(x, ...)

Arguments

topic

The name of an object, or the topic to search for, if this is not the name of a known object.

...

Further arguments passed to help().

type

First argument to ⁠?⁠. If it is a dot, like .?topic, the second argument is a topic passed to the about() function. Otherwise, it is the first argument to restrict help pages, like class, methods, or method. See examples for how to use it.

x

The name of a function.

Value

A string with the location of all objects named topic are found is returned invisibly.

See Also

help(), help.search(), apropos()

Examples

## Not run: 
about("nonexisting") # Not found on search path, but help pages
about("htgdsfgfdsgf") # Not found anywhere
#library(tidyverse)
#about("group_by") # Just one page
#about("filter") # Several items
about("stats::filter") # OK
#about("dplyr::filter") # OK too
about("base::filter") # Not found there
# Objects with comment: print comment
vec <- structure(1:10, comment = "A simple vector")
about("vec")
# If there is a srcfile attribute in the comment, also display the file
# Hint: integrate some help in the header!
#library(data)
#(iris <- read(data_example("iris.csv")))
#about("iris")
# If the comment has a src attribute, change the topic to that one
#urchin <- read("urchin_bio", package = "data")
#about("urchin")
.?filter
.?stats::filter

## End(Not run)

SciViews/svMisc documentation built on Sept. 15, 2023, 3:51 a.m.