Learn R Programming

quickcheck (version 0.1.3)

flat_list_of: Variable length flat list generator

Description

Generate flat lists with all values coming from a single generator. In a flat list all items will be scalars.

Usage

flat_list_of(generator, len = c(1L, 10L))

Value

A quickcheck_generator object.

Arguments

generator

A quickcheck_generator object.

len

Length of the generated vectors. If len is a single number all vectors will have this length. If len is a numeric vector of length 2 it will produce vectors with lengths between a minimum and maximum, inclusive. For example len = c(1L, 10L) would produce vectors with lengths between 1 and 10. To produce empty vectors set len = 0L or a range like len = c(0L, 10L).

Examples

Run this code
flat_list_of(integer_(), len = 10L) %>% show_example()

Run the code above in your browser using DataLab