man: Display a Help Page From a File's Documentation

View source: R/man.R

manR Documentation

Display a Help Page From a File's Documentation

Description

Display a help-like page from an existing R documentation (*.Rd) file, a topic from a temporary package with options("document_package_directory") set or a topic from an R code file containing roxygen2 documentation.

Usage

man(x, topic = NA, force_Rd = FALSE)

Arguments

x

One of the following:

  • A path to an R documentation (*.Rd) file.

  • A path to a code file containing comments for roxygen2.

  • A help topic if options("document_package_directory") is set (by document).

topic

A help topic if x is a path to a code file containing comments for roxygen2.

force_Rd

if x is a file's path, then is_Rd_file is used to decide whether the file is an R documentation file and call document otherwise. Set to TRUE to disable this check and force the file to be assumed to be an R documentation file. is_Rd_file may produce false negatives.

Value

Invisibly the status of display_Rd.

Examples


document::document(file_name = system.file("files", "minimal.R",
                   package = "document"), check_package = FALSE)
document::man("foo")
# this equivalent to
path <- system.file("files", "minimal.R", package = "document")
document::man(x = path, topic = "foo")


document documentation built on Aug. 19, 2022, 5:23 p.m.