f_replace {clickR}R Documentation

Find and replace

Description

Searches a data.frame for a specific character string and replaces it with another one

Usage

f_replace(
  x,
  string,
  replacement,
  complete = TRUE,
  select = 1:ncol(x),
  track = TRUE
)

Arguments

x

A data.frame

string

A character string to search in the data.frame

replacement

A character string to replace the old string (can be NA)

complete

If TRUE, search for complete strings only. If FALSE, search also for partial strings.

select

Numeric vector with the positions (all by default) to be affected by the function

track

Track changes?

Examples

iris2 <- f_replace(iris, "setosa", "ensata")
track_changes(iris2)

[Package clickR version 0.9.39 Index]