Learn R Programming

xpectr (version 0.4.4)

simplified_formals: Extract and simplify a function's formal arguments

Description

lifecycle::badge("experimental")

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

Usage

simplified_formals(fn)

Value

A character vector with the simplified formals.

Arguments

fn

Function.

Author

Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk

Examples

Run this code
# Attach packages
library(xpectr)

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

simplified_formals(fn1)

Run the code above in your browser using DataLab