na_literal: Mutate an NA or NULL literal

View source: R/mutator-na.R

na_literalR Documentation

Mutate an NA or NULL literal

Description

Replaces NA, NULL, or a typed NA constant (NA_real_, NA_integer_, NA_complex_, NA_character_) with another value.

Usage

na_literal(from, to)

Arguments

from

The literal to replace. One of "NA", "NULL", "NA_real_", "NA_integer_", "NA_complex_", "NA_character_".

to

The replacement literal.

Details

In tree-sitter-r, NA and all typed NA variants share the same na node type, while NULL has its own null node type. match_fn distinguishes between them by comparing the literal text.

Value

A Mutator object.

Examples

na_literal("NULL", "NA")
na_literal("NA", "NULL")
na_literal("NA", "NA_real_")
na_literal("NA_real_", "NA")

muttest documentation built on May 14, 2026, 5:10 p.m.