All the parameters (excluding regexp
) are attached to column definition
when the ones are not specified in configuration YAML file.
All the functions are used to specify default configuration
(see: default_faker_opts
).
opt_default_character(
regexp = "text|char|factor",
nchar = 10,
na_ratio = 0.05,
not_null = FALSE,
unique = FALSE,
default = "",
levels_ratio = 1,
...
)
opt_default_numeric(
regexp = "^decimal|^numeric|real|double precision",
na_ratio = 0.05,
not_null = FALSE,
unique = FALSE,
default = 0,
precision = 7,
scale = 2,
levels_ratio = 1,
...
)
opt_default_integer(
regexp = "smallint|integer|bigint|smallserial|serial|bigserial",
na_ratio = 0.05,
not_null = FALSE,
unique = FALSE,
default = "",
levels_ratio = 1,
...
)
opt_default_logical(
regexp = "boolean|logical",
na_ratio = 0.05,
not_null = FALSE,
unique = FALSE,
default = FALSE,
levels_ratio = 1,
...
)
opt_default_date(
regexp = "date|Date",
na_ratio = 0.05,
not_null = FALSE,
unique = FALSE,
default = Sys.Date(),
format = "%Y-%m-%d",
min_date = as.Date("1970-01-01"),
max_date = Sys.Date(),
levels_ratio = 1,
...
)
Regular expression that allows mapping YAML configuration column type to desired R class.
Maximum number of characters when simulating character values.
When source column is of type char(n)
the parameter is ignored.
Ratio of NA values returned in simulated sample.
Should the column allow to simulate NA values?
Should column values be unique?
Default column value. Ignored during simulation.
Ratio of unique values (in terms of sample length) simulated in the sample.
Other default parameters attached to the column definition.
Precision of numeric column value when simulating numeric values.
When source column is of type e.g. numeric(precision)
the parameter is ignored.
Precision of numeric column value when simulating numeric values.
When source column is of type e.g. numeric(precision, scale)
the parameter is ignored.
Format of date used when simulating Date columns.
Minimum and maximum date used when simulating Date columns.