Insert Methods
insert_methods(
content,
start_pos = 1,
field = c("all", "public", "private"),
method = c("both", "get", "set"),
add_roxygen = TRUE
)Character, content of the file or a string
Integer, position of cursor within `content`. Number of characters before the cursor.
Character, fields for which to create method. May be "all", "public", "private" or name of class field. Multiple values allowed.
Character, methods to create. One of "both", "get", "set"
Logical, whether to add roxygen description of method
Character, modified content with injected methods