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 = NULL, add_cr = TRUE)

Arguments

id

Type identifier. One of "chr", "date", "df", "fct", "int", "lgl", "list", "mat", "num", "pg_conn" or "raw"

length

Length of the R object to be documented. Omitted if NULL.

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_conn")
#> [1] "[`PqConnection`][RPostgres::dbGetInfo_PqConnection]\\cr"