Read and Write FWF Files in the Blaise Format
Can be used to read and write a fwf with an accompanying blaise datamodel.
When supplying a datamodel for writing, the dataframe will be automatically converted
to that format and checked for compatibility.
Supports dataframes, tibbles and LaF objects.
Blaise R package
This package provides function for reading and writing blaise fixed width files with a datamodel (usually with extension .bla) symmetrically. Symmetry in this case means that reading a dataset in R and then immediately writing it out, should result in the exact same dataset and datamodel.
All types except arrays are currently supported. Datamodels have only been tested as separate files, so datamodels within larger manipula or maniplus scripts for instance are not guaranteed to work.
In addition, an R dataframe can be forced to conform to a known blaise datamodel. For this to work variable names in the dataframe need to match the datamodel. a simple name matching scheme based on minimizing the Levenshtein distance is supplied.
Since blaise and R datatypes don't exactly overlap, some are automatically converted:
- R Logical type is always converted to an INTEGER with FALSE:0 and TRUE:1 when writing.
- numbered blaise enums are converted to factors with the numbers as labels. The original labels are therefore lost. (possibly will be implemented as new R vector in the future). This can be suppressed, but the default is to convert due to the symmetric design principle.
For reading fwf files an option is available to output LaF objects. In this way the package is used as an alternative datamodel parser for the LaF package.
Functions in blaise
|read_fwf_blaise||Read a fixed width datafile using a blaise datamodel|
|write_fwf_blaise_with_model||Write a fixed width ascii datafile based on a given blaise datamodel|
|write_fwf_blaise||Write a fixed width ascii datafile and accompanying blaise datamodel|
Vignettes of blaise
Last month downloads
|Collate||'clean_model.R' 'generics.R' 'utils.R' 'variable.R' 'model.R' 'convert_df.R' 'convert_type.R' 'get_model.R' 'read_custom_types.R' 'read_data.R' 'read_data_laf.R' 'read_fwf_blaise.R' 'read_model.R' 'variable_custom.R' 'variable_date.R' 'variable_dummy.R' 'variable_enum.R' 'variable_integer.R' 'variable_real.R' 'variable_string.R' 'write_data.R' 'write_datamodel.R' 'write_fwf_blaise.R' 'write_fwf_blaise_with_model.R'|
|Packaged||2019-05-11 12:02:33 UTC; kingmob|
|Date/Publication||2019-05-15 13:00:03 UTC|
Include our badge in your README