This function allows the replacement of an entire line in table notes. The line which is replaced is matched by a regular expression or identified directly with the integer position in the notes vector to replace.

st_notes_sub(x, where, replacement, fixed = FALSE)

Arguments

x

an stobject.

where

a regular expression for finding a line in table notes to replace; alternatively, this can be an integer specifying the line to replace.

replacement

the replacement text for line matching by where.

fixed

passed to grep() when where is character.

Value

An updated object with class stobject, which can be piped to other functions.

Details

A warning is generated if there are no notes already existing in x. A warning is also generated if a regular expression fails to match any lines. In case multiple lines are matched, only the first matching line is substituted.