Description Usage Arguments Value
easyswap
is a function that efficiently finds and replaces all instances of a given
value with another given value. This occurs across all columns to use, unless an optional argument
specifying the columns is provided.
1 2 |
dt |
A data.table to search and swap values in |
find |
A value to find across all or a subset of columns. Default is NA. |
swap |
A value to replace 'find' with |
cols |
An optional character vector giving the names of the columns to make the swap in. If not provided, swap will happen across all columns. See examples below. |
force |
A boolean value specifying whether to try and coerce column classes in the event where the swap value is a different data type than the column. See examples below. |
copy |
A boolean value indicating whether to make the swap on a COPY of the data. Default is false and the swap is made in memory. See examples below. |
A modified copy of dt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.