gen.structure {hedgehog} | R Documentation |
Generate a structure
Description
If you can create an object with structure
,
you should be able to generate an object with
this function from a generator or list of
generators.
Usage
gen.structure(x, ...)
Arguments
x |
an object generator which will have various attributes attached to it. |
... |
attributes, specified in 'tag = value' form, which will be attached to generated data. |
Details
gen.structure accepts the same forms of data as forall, and is flexible, in that any list of generators is considered to be a generator.
Examples
# To create a matrix
gen.structure( gen.c(of = 6, gen.element(1:30)), dim = 3:2)
# To create a data frame for testing.
gen.structure (
list ( gen.c(of = 4, gen.element(2:10))
, gen.c(of = 4, gen.element(2:10))
, c('a', 'b', 'c', 'd')
)
, names = c('a','b', 'constant')
, class = 'data.frame'
, row.names = c('1', '2', '3', '4' ))
[Package hedgehog version 0.1 Index]