This utility function extracts elements from a vector x by names.
Differences to the standard [ function are:
extract_by_name(x, names)NULL if x is NULL, otherwise the extracted elements from x.
(named vector)
where to extract named elements from.
(character)
vector of names to extract.
If x is NULL, then still always NULL is returned (same as in base function).
If x is not NULL, then the intersection of its names is made with names and those
elements are returned. That is, names which don't appear in x are not returned as NAs.