extract_by_name {tern} | R Documentation |
Extract elements by name
Description
This utility function extracts elements from a vector x
by names
.
Differences to the standard [
function are:
Usage
extract_by_name(x, names)
Arguments
x |
(named |
names |
( |
Details
If
x
isNULL
, then still alwaysNULL
is returned (same as in base function).If
x
is notNULL
, then the intersection of its names is made withnames
and those elements are returned. That is,names
which don't appear inx
are not returned asNA
s.
Value
NULL
if x
is NULL
, otherwise the extracted elements from x
.
[Package tern version 0.9.6 Index]