Description Usage Arguments Details Value Algorithm See Also
Decimal character detection to csv files loading with data.table::fread
1 | dl_dec_char_detect(file, n = 1000, parent_logger = "test")
|
file |
Character vector indicating the name (and route) of the file in which the decimal character must be guessed. |
n |
Numeric indicating the sample size of rows to use in the decimal character guessing. |
With data coming from any place in the world, data loading functions have to
cope with different decimal characters, separator characters...
fread
can autodetect separator character at loading
data, but decimal character must be specified in order to load correct data.
This function aims to provide an easy way to autodetect decimal character to
automatize data loading proccess.
A character vector containing the decimal character, to use in the fread order to load the data.
The process to determine the decimal character is as follows:
1000 rows and 4 variables are sampled from the data.
For each variable, number of dots (.
) and commas (,
)
are calculated.
If the number of dots is larger than the commas, dot is selected as decimal character. If the number of commas is larger than the dots, comma is selected as decimal character.
Other Data Loading Functions: dl_data_col_classes
,
dl_data
, dl_get_si_code
,
dl_metadata
,
dl_na_char_generator
,
qc_as_timestamp
,
remove_dupcols
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.