View source: R/file_definition.R
Helper function for new_file_definition_fwf()
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 | new_file_definition_fwf_(
file_path,
specification_files = NULL,
cols = NULL,
col_names = NULL,
col_types = NULL,
col_start = NULL,
col_end = NULL,
col_widths = NULL,
file_meta = NULL,
sep_width = NULL,
skip_rows,
na,
decimal_mark,
big_mark,
trim_ws,
n_max,
encoding,
to_lower,
adapters = new_adapters(),
cols_keep,
extra_col_name = NULL,
extra_col_val = NULL,
extra_col_file_path,
err_h,
...
)
|
file_path |
A string holding the path to the data file. |
specification_files |
An optional character vector holding the paths to the files, where the file structure is described. |
cols |
An optional list argument, holding the column definitions.
This argument can be used instead of the arguments
|
col_names |
An optional character vector holding the names of the columns.
If omitted, then the strings |
col_types |
A character vector defining the data types for each column.
The following strings are allowed: |
col_start |
An optional numeric vector holding the positions of the first character
of each column.
Generally, the argument |
col_end |
An optional numeric vector holding the positions of the last character
of each column. The last vector entry (for the most right column)
is the only entry that can be |
col_widths |
An optional numeric vector holding the numbers of characters
of each column.
Generally, the argument |
file_meta |
An optional file_meta class object,
holding some meta information for each data column
(column description, possible column values + descriptions of possible
column values).
For details see section meta information.
If the argument |
sep_width |
An optional number, defining the number of characters
between each column (often |
skip_rows |
The number of rows to be skipped. In the case of DSV or
EXCEL files: If the argument |
na |
A string representing missing values in the data file. |
decimal_mark |
A character, defining the decimal separator in numeric
columns. Only the strings |
big_mark |
A character, defining the thousands separator in numeric
columns. Only the strings |
trim_ws |
A logical value, defining if the character values should be stipped of all leading and trailing white spaces. |
n_max |
A number, defining the maximum number of rows to be
read. If |
encoding |
A string, defining which encoding should be assumed when reading the data file. The following valuels are allowed:
|
to_lower |
A logical flag, defining if the names of the columns should
be transformed to lower case after reading the data set (by calling
|
adapters |
An optional list argument, holding a list of adapter functions (See section adapters). |
cols_keep |
Either |
extra_col_name |
An optional string, which defines the column, which
will be added to the data set (after reading it with function |
extra_col_val |
An optional value (any atomic type), which will be added
(after reading the data set with function |
extra_col_file_path |
Either |
err_h |
An error handler |
... |
Additional function arguments for
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.