Description Usage Arguments Value adapters
Helper function for apply_adapters()
1 2 3 4 5 | apply_adapters_(
data,
file_definition,
err_h = composerr("Error while calling 'apply_adapters_()'")
)
|
data |
The data.frame, which should be modified |
file_definition |
A file_definition class object holding the adapter functions, which should be applied to the data.frame. |
err_h |
An error handler |
The modified data.frame
An adapter function is a function that takes a data.frame as input argument
and returns a modified version of this data.frame.
The adapter functions are stored in an adapters
class object, which is a special list that contains all adapter functions
and a description text of each function. This class objects can be
created by using the function new_adapters()
.
The adapters class objects can be added to a
file_structure or a
file_definition or a file_collection class object.
After reading a data file (by calling read_data(file_definition))
all adapter functions listed in the adapters
argument of the
file_definition]new_file_definition()
class object
will be applied consecutively to the loaded data set.
Adapter functions can be added to an existing
file_structure or a file_definition or
a file_collection class
object by using the function add_adapters()
.
Adapter functions can be used for several tasks:
adapt the data sets in such a way that they can be concatenated for mutliple years
compute new variables from existing variables
fix errors in variables
transform the values of a variable of an older data set, such that it complies with a newer variable definition
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.