format_code: Format code with one or multiple terms

View source: R/get_segment_table.R

format_codeR Documentation

Format code with one or multiple terms

Description

Take a value like "a + b" and (1) replace it with NA if na_col == NA. (2) Change to "(a + b)" if there is a "+" (3) Return itself otherwise, e.g., "a" –> "a".

Usage

format_code(col, na_col)

Arguments

col

A column

na_col

If this column is NA, return NA

Value

string

Author(s)

Jonas Kristoffer Lindeløv jonas@lindeloev.dk


mcp documentation built on May 29, 2024, 6:15 a.m.