Skip to contents

Returns a predefined R object type hint intended to be used to document a function parameter's type.

Usage

type(id = data_types$id, length = 1L, add_cr = TRUE)

Arguments

id

Type identifier. One of "chr", "date", "int", "lgl", "num" or "pg_connection"

length

Length of the R object to be documented.

add_cr

Whether or not to suffix the returned string with an Rd line break (\cr).

Value

A glue character scalar.

See also

Examples

pkgsnip::type(id = "lgl",
              length = 3L)
#> [1] "[`logical(3)`][base::logical]\\cr"

pkgsnip::type(id = "pg_connection")
#> [1] "[`PqConnection`][RPostgres::dbGetInfo_PqConnection]\\cr"