Description Usage Arguments Details Examples
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.
1 | gen.structure(x, ...)
|
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. |
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.
1 2 3 4 5 6 7 8 9 10 11 12 | # 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' ))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.