type {cppcontainers} | R Documentation |
Get data type
Description
Obtain the data type of a container.
Usage
type(x)
Arguments
x |
A |
Details
The available types are integer, double, string, and boolean. They correspond to the integer, numeric/ double, character, and logical types in R.
Value
A named character vector for CppMap, CppUnorderedMap, CppMultimap, and CppUnorderedMultimap objects. A character otherwise.
See Also
Examples
s <- cpp_set(4:6)
type(s)
# [1] "integer"
m <- cpp_unordered_map(c("hello", "world"), c(0.5, 1.5))
type(m)
# key value
# "string" "double"
[Package cppcontainers version 1.0.0 Index]