New function vm@vame_harmonise_dt
.
vm@var_meta_is_defined
now also allows var_nm = NULL
. Then it returns
TRUE/FALSE
depending on whether meta_nm
is a column name of var_dt
.
vm@var_set_meta_is_defined
now also accepts id = NULL
. Then
vm@var_set_meta_is_defined
tests whether meta_nm
is a column name of
var_set_dt
.
New function vm@var_var_set_dt_id_set_get
.
New function vm@var_var_set_dt_pos_set_get
.
vm@vame_union_append
now adds metadata from vm_2
into vm
even for
pre-existing variables where that particular metadata is missing in
vm
. Previously only new variables were added and pre-existing variables'
metadata were untouched.
All functions that auto-infer id
/ids
which require multiple
metadata for the id
now makes use of the preference defined in the
function. For instance, requiring an id
to have either sampler
or
value_space
now causes the id
value with sampler
defined to
be preferred even if a separate one has value_space
.
vm@vame_value_space_sample
arg ids
auto-inference now only finds
ids
which have either sampler
or value_space
.
vm@vame_value_space_sample_default
arg ids
auto-inference now only finds
ids
which have either sampler
or value_space
.
vm@var_set_value_space_sample
arg id
auto-inference now only finds
one id
which has either sampler
or value_space
.
vm@vame_make
now sets the attribute vame_make_meta
on its output.
vm@var_set_make
now sets attribute var_set_make_meta
on its output.
New function vm@var_set_maker_get_dep_var_nm_sets
.
Rename vm@vame_make
callbacks
element pre_loop
to pre_lapply
.
vm@vame_make
gains callbacks
element lapply_on_entry
.
vm@vame_make
gains callbacks
element lapply_on_exit
.
vm@vame_make
gains callbacks
element lapply_pre_var_set_make
.
Rename vm@vame_make
callbacks
element post_var_set_make
to
lapply_post_var_set_make
.
vm@var_set_make
can now handle a maker
of type list
with element
dep_var_nm_sets
.
A maker
of type list
can now have element dep_var_nm_sets
instead
of dep_var_nm_set
. dep_var_nm_sets
must be a list
of variable name
sets --- different allowed options. If your maker
only works on one
specific set of dependency variables, it is easier for you to keep using
dep_var_nm_set
. The possibility of using dep_var_nm_sets
was added
to enable writing a maker
such as
quote(switch(dep_var_nm_set, b = b + 1L, c = c - 1L))
, where the target
variable can be made using either b
or c
.
Fixed vame::self()
--- it failed to find the VariableMetadata
object
in some cases although it is intended to work until deletion.
vame::self()
deprecated. Refer to the vame::VariableMetadata
itself
using vm
.
vm@var_description_get
now makes variables var_nm
, descr_nm
, and vm
available for describer
types function
and call
.
vm@var_labels_get
now makes variables x
, var_nm
, label_nm
, and vm
available for labeler
types function
and call
.
vm@var_labels_get
now makes variables id
, var_nms
, and vm
available for labeler
types function
and call
.
vm@var_set_value_space_sample
object x
passed to the sampler
renamed
to vm
. It is the VariableMetadata
object itself.
vm@vame_make
gains callbacks
element on_entry
.
vm@vame_make
gains callbacks
element pre_loop
.
vm@vame_make
gains argument callbacks
.
An individual description text for a describer
can now be a character
string vector (without NA
) with more than one element. Formerly
length one was required.
The elements of a describer
of type list
can now be vectors with
more than one element. Formerly only vectors of length one were allowed.
vm@var_meta_set
now always wraps value
into a list before adding
it into vm
when meta_nm %in% c("describer", "labeler")
--- those are
known list
columns.
vm@var_set_meta_set
now always wraps value
into a list before adding
it into vm
when meta_nm %in% c("value_space", "maker")
--- those are
known list
columns.
vm@vame_meta_set
now checks value
for validity for "officially"
defined metadata such as sampler
. Formerly this was done only by
the corresponding wrapper such as vm@vame_value_space_sampler_set
.
vm@var_meta_set
now checks value
for validity for "officially" defined
metadata such as describer
. Formerly this was done only by
the corresponding wrapper such as vm@var_describer_set
.
vm@var_set_meta_set
now checks value
for validity for "officially"
defined metadata such as value_space
. Formerly this was done only by
the corresponding wrapper such as vm@var_set_value_space_set
.
vm@vame_copy
now also copies vame_list
.
Fix use of substitute
in turning args var_dt_expr
+ var_set_dt_expr
into a quoted expression.
Fixed an extra comma in a function call when
ids
was NULL
and var_nms
was used to infer the ids
(e.g. vm@var_set_make
).
vm@var_set_make
passing var_nms
fixed. It used to pass the
var_nm_set
for the corresponding variable set, now it passes arg
var_nms
(whether inferred or user-given) as intended.
maker
objects of type function
can no longer have ...
in their
definition to enable proper checks on inputs when the maker
is called.
vm@var_set_maker_set
now ignores arguments passed via data
to a
maker
of type function
that do not correspond to any argument name.
vm@var_set_value_space_sample
arg id
now NULL
by default.
You can supply either id
or var_nms
and the other one is inferred,
if NULL
.
vm@vame_make
gains argument var_nms
. You can now pass either ids
or
var_nms
or both.
vm@vame_make
automatically determines the appropriate order of ids
(whether user-supplied or inferred) in which their maker
s should be
called. For instance if maker
for ids[1]
requires the variables
created by the maker
for ids[2]
, then the latter is called first.
vm@var_set_make
gains argument var_nms
. You can now pass either id
or
var_nms
or both.
vm@var_set_make
now raises an informative error if data
did not
contain something the maker
needs.
Fixed a utility function used by vame::vame_value_space_sample_default
.
vame::VariableMetadata
now automatically sets var_dt$type
to
"categorical"
where the variable's value_space
is of type
dt
or set
or when var_dt$labeler
has been defined. Remember that
this only occurs when vame::VariableMetadata
is called and any
additional variables you add later will not be treated automatically.
Also, if var_dt$type
was already something other than NA
for a
variable, the automatic determination is not attempted.
vm@var_dt_copy
now actually returns var_dt
instead of var_set_dt
.
vm@var_set_dt_copy
now actually returns var_set_dt
instead of var_dt
.
var_dt$labeler
of class data.table
specs changed: Now column
containing values for the variable in question must be named x
.
Formerly this was level
.
Added recommendations for constructing vame::VariableMetadata
objects into
documentation.
vm@vame_value_space_sample
gains arguments ids
and data
.
vm@vame_value_space_sample_default
gains arguments ids
and data
.
vm@var_aggregate
now always considers it possible to aggregate to
to_var_nm
if it only has one value.
New function vm@var_describer_get
.
New function vm@var_describer_set
.
New function vm@var_description_get
.
vm@var_description_get
arg description_name
renamed to descr_nm
.
vm@var_labels_get
arg label_col_nm
renamed to label_nm
.
vm@var_meta_is_defined
internal problem fixed.
vm@var_set_make
argument data
can now also be a list
object.
vm@var_set_value_space_sample
now has new arg data
. Pass your data via
data
when you have a conditional sampling method.
New function vame::self
.
New function vm@vame_make
.
New function vm@var_set_make
.
New function vm@var_set_maker_get
.
New function vm@var_set_maker_set
.
vame::VariableMetadata
gains arg vame_list
.
New function vm@vame_list_copy
.
New function vm@vame_meta_get
.
New function vm@vame_meta_is_defined
.
New function vm@vame_meta_set
.
New function vm@var_set_meta_is_defined
.
New function vm@vame_value_space_sample_default
.
New function vm@vame_value_space_sampler_get
.
New function vm@vame_value_space_sampler_set
.
New function vm@var_dt_copy
.
New function vm@var_meta_is_defined
.
vm@var_meta_set
now wraps value
into a list if it isn't a list
and if the target column is a list.
Fix renaming multiple variables on one go.
New function vm@var_set_dt_copy
.
New function vm@var_set_meta_is_defined
.
vm@var_set_meta_set
now wraps value
into a list if it isn't a list
and if the target column is a list.
New slot function var_set_value_space_sample
.
New slot function var_set_value_space_sampler_get
.
New slot function var_set_value_space_sampler_set
.
New function vm@var_value_space_sample
.
A labeler
can now also be of class call
.
vm@var_labels_get
now can handle labeler
s of class call
.
Added argument labeler_env
for this purpose.
label_dt
was renamed to labeler
.
Rename expr
to var_dt_expr
. Add arg var_set_dt_expr
.
Rename x
to vm_2
.
A labeler
can now be of type function
in addition to data.table
.
vm@var_labels_get
now can handle labeler
s of type function
.
vm@var_meta_get_all
now always sets var_dt$var_nm
as the names
of the output list or vector.
Rename old
to old_var_nms
and new
to new_var_nms
.
vm@var_set_meta_get_all
now always sets var_set_dt$id
as the names
of the output list or vector.
Rename old
to old_ids
and new
to new_ids
.
Rename vm@var_set_get
to vm@var_set_var_nm_set_get
.
Rename vm@var_set_list_get
to vm@var_set_var_nm_set_get_all
.
New function vm@var_set_var_nm_set_set
.
vm@var_remove
can now remove multiple variables in one go.
vame::var_set_value_space_eval
+ vm@var_set_value_space_eval
gain
arg var_nms
. You can now evaluate the value space for only a subset of
the variables in the set.
New slot fun vm@vame_copy
+ new exported fun vame::vame_copy
.
New value_space
type: "unrestricted". Use this when a variable must
be of a certain class but can take any value. E.g.
list(unrestricted = list(class_set = c("IDate", "Date")))
.
New value_space
type: "regex". Use this when all values of a variable
must match a specific regex. E.g. list(regex = "^[a-z]$")
.
New exported fun vame::var_set_value_space_eval
--- alternative for
vm@var_set_value_space_eval
.
fix vame_union_append
--- no longer attempt to remove duplicates
in rbind'd var_dt
because some by
columns may be of type list
which is not supported by duplicated
.
Robustify vame_union_append
--- use use.names = TRUE, fill = TRUE
in rbind
calls.
Fixed vame_union_append
--- used to always raise an error due to
a misnamed object.
New slot var_aggregate
.
vm@var_assert
gains arg env
. This is passed
to vm@var_value_space_eval
.
New slot var_is_aggregateable_to
.
Also bounds
value space can be used when creating category spaces.
Also bounds
value space can be used when creating category spaces.
Added arguments x_nm
, call
.
Fixed var_assert
handling of a value space based on bounds
.
New slot vm@var_set_value_space_eval
.
New slot vm@var_value_space_eval
.
First release.