Learn R Programming

cppcontainers (version 1.0.4)

max_load_factor: Get or set the maximum load factor

Description

Get or set the maximum load factor by reference, i.e. the number of elements per bucket.

Usage

max_load_factor(x, max_load = NULL)

Value

Returns a numeric, if max_load is NULL. Invisibly returns NULL, if max_load is numeric.

Arguments

x

A CppUnorderedSet, CppUnorderedMultiset, CppUnorderedMap, or CppUnorderedMultimap object.

max_load

The containers maximum load factor. If NULL, the function returns the container's current maximum load factor. Passing a number sets the maximum load factor to that value.

See Also

bucket_count, load_factor, max_bucket_count.

Examples

Run this code
s <- cpp_unordered_set(4:6)
max_load_factor(s)
# [1] 1

max_load_factor(s, 3)
max_load_factor(s)
# [1] 3

Run the code above in your browser using DataLab