| contains | R Documentation |
Check, if elements are part of a container.
contains(x, values)
x |
A CppSet, CppUnorderedSet, CppMultiset, CppUnorderedMultiset, CppMap, CppUnorderedMap, CppMultimap, or CppUnorderedMultimap object. |
values |
Values whose existence to assess. Refers to keys in the case of CppMap, CppUnorderedMap, CppMultimap, and CppUnorderedMultimap objects. |
Returns a logical vector of the same length as values, denoting for each value whether it is part of x (TRUE) or not
(FALSE).
[, at, back, front, top.
s <- cpp_multiset(4:9)
s
# 4 5 6 7 8 9
contains(s, 9:11)
# [1] TRUE FALSE FALSE
m <- cpp_unordered_map(c("hello", "world"), 3:4)
m
# ["world",4] ["hello",3]
contains(m, c("world", "there"))
# [1] TRUE FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.