| setdiffNamed | R Documentation |
setdiff, but takes into account namesThis will identify the elements in l1 that are not in l2. If
missingFill is provided, then elements that are in l2, but not in l1
will be returned, assigning missingFill to their values. This might be
NULL or "", i.e., some sort of empty value. This function will work on
named lists, named vectors and likely on other named classes.
setdiffNamed(l1, l2, missingFill)
l1 |
A named list or named vector |
l2 |
A named list or named vector (must be same class as |
missingFill |
A value, such as |
There are 3 types of differences that might occur with named
elements: 1. a new named element, 2. an removed named element, and 3. a
modified named element. This function captures all of these. In the case of
unnamed elements, e.g., setdiff, the first two are not seen as differences,
if the values are not different.
A vector or list of the elements in l1 that are not in l2, and
optionally the elements of l2 that are not in l1, with values set to
missingFill
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.