Description Usage Arguments Value
After reading a data file the following functions will be executed:
retype_cols_(): If the retype_cols argument in the file_definition
class object is set to TRUE and the col_types argument is not empty,
then the data types of the columns in the read data set
will be transformed to the data types given in the col_types argument.
rename_cols_(): If the rename_cols argument in the file_definition
class object is set to TRUE and the col_names argument is not empty,
then the column names of the read data set
will be overwritten by the values in the col_names argument.
apply_to_lower_(): If the to_lower argument in the file_definition
class object is set to TRUE, then the column names of the read data set
will be transformed to lower case.
compare_col_names_(): If the col_names are given in the
[file_definition][new_file_definition())] class object and the header row was used as well
(for SAS-files always, or for DSV- and EXCEL-files when header = TRUE),
then the column names read by [read_data()] will be compared with the given
col_names. In case of differences, a warning will be printed.
[compare_col_types_()]: If the col_types are given in the
[file_definition][new_file_definition())] class object, then the data types in the data
columns read by [read_data()] will be compared with the given
col_types. In case of differences, a warning will be printed.
[add_meta_()]: The meta data of each column (defined in
file_definition$file_meta) will be added as an attribute to each data.frame column.
[apply_adapters_()]: Apply all adapters stored in the adapters attribute of
the file_definition class object on the data set.
[apply_cols_keep_()]: Only keep the columns defined in the cols_keep
attribute of the file_definition class object.
If file_definition$cols_keep is not NULL only the columns with the column names
given in file_definition$keep_cols are kept.
[add_extra_cols_()]: As defined in the extra_cols_* attributes
of the file_definition class object, add additional columns.
If file_definition$extra_col_name is not NULL, then this value will be used as
a column name and the value stored in file_definition$extra_col_val will be used
as column value.
If file_definition$extra_col_file_path is not NULL, then this value will be used
as column name and the value file_definition$file_path will be used as column
value.
[new_file_definition())]: R:new_file_definition()) [read_data()]: R:read_data() [compare_col_types_()]: R:compare_col_types_() [new_file_definition())]: R:new_file_definition()) [read_data()]: R:read_data() [add_meta_()]: R:add_meta_() [apply_adapters_()]: R:apply_adapters_() [apply_cols_keep_()]: R:apply_cols_keep_() [add_extra_cols_()]: R:add_extra_cols_()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | read_data_post_process(data, file_definition, err_h)
rename_cols_(
data,
file_definition,
err_h = composerr("Error while calling 'rename_cols_()'")
)
retype_cols_(
data,
file_definition,
err_h = composerr("Error while calling 'retype_cols_()'")
)
add_extra_cols_(
data,
file_definition,
err_h = composerr("Error while calling 'add_extra_cols_()'")
)
apply_to_lower_(
data,
file_definition,
err_h = composerr("Error while calling 'apply_to_lower_()'")
)
compare_col_names_(
data,
file_definition,
err_h = composerr("Error while calling 'compare_col_names_()'")
)
compare_col_types_(
data,
file_definition,
err_h = composerr("Error while calling 'compare_col_types_()'")
)
apply_cols_keep_(
data,
file_definition,
err_h = composerr("Error while calling 'apply_cols_keep_()'")
)
add_meta_(
data,
file_definition,
err_h = composerr("Error while calling 'add_meta_()'")
)
|
data |
The data.frame, which should be modified |
file_definition |
A file_definition class object, holding the file information of the data file. |
err_h |
An error handler. |
The modified data.frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.