Description Usage Arguments Details Examples
This function replaces elements in a vector. It is a link to replace as a generic function.
1 2 3 4 5 6 7 8 9 10 |
x |
(atomic | list) a vector. |
ind |
used as index for elements to be replaced. See details. |
values |
the values used for replacement. |
... |
arguments passed to |
The idea is to provide a more flexible interface for the
specification of the index. It can be a character, numeric, integer or
logical which is then simply used in base::replace
. It can be a
regular expression in which case x
should be named – a character of
length 1 and a leading "^" is interpreted as regex. When ind
is a
function (or formula) and x
is a list then it should be a predicate
function – see the examples. When x is an atomic the function is applied
on x and the result is used for subsetting.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.