simplified_formals: Extract and simplify a function's formal arguments

View source: R/simplified_formals.R

simplified_formalsR Documentation

Extract and simplify a function's formal arguments

Description

\Sexpr[results=rd, stage=render]{lifecycle::badge("experimental")}

Extracts formals and formats them as an easily testable character vector.

Usage

simplified_formals(fn)

Arguments

fn

Function.

Value

A character vector with the simplified formals.

Author(s)

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

Examples

# Attach packages
library(xpectr)

fn1 <- function(a = "x", b = NULL, c = NA, d){
  paste0(a, b, c, d)
}

simplified_formals(fn1)

xpectr documentation built on Nov. 18, 2022, 5:10 p.m.