simplified_formals {xpectr}R Documentation

Extract and simplify a function's formal arguments

Description

[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)

[Package xpectr version 0.4.3 Index]