debug_ascii {speedycode} | R Documentation |
Debug errors when converting ASCII files with the readroper package
Description
A common issue when converting ASCII files is getting the column positions, variable widths, and new variable names to align. A simple way to debug errors is to compare the lengths of each which must be equivalent to convert ASCII files with the readroper package. debug_ascii calculates the lengths of each of these inputs so you can quickly diagnose errors. Each argument can be copied directly from the 'read_rpr' function within the readroper package.
Usage
debug_ascii(col_positions_input, widths_input, col_names_input)
Arguments
col_positions_input |
The col_positions argument in the read_rpr function |
widths_input |
The widths argument in the read_rpr function |
col_names_input |
The col_names argument in the read_rpr function |
Value
A dataframe containing the lengths of the col_positions, widths, and col_names arguments
Author(s)
Jacob Harris
Examples
## Not run: For ease of replicability, the examples here
come from generated data rather than data from
an ASCII file.
## End(Not run)
col_positions <- c(1, 2, 3, 5, 8)
widths <- c(1, 1, 2, 3, 1)
col_names <- c("Q1", "Q2", "Q3", "Q4", "Q5")
debug_ascii(col_positions, widths, col_names)
## Not run: Now, if the lengths differ from an error
(see the missing "Q4" variable), the function
will throw a warning.
## End(Not run)
col_positions <- c(1, 2, 3, 5, 8)
widths <- c(1, 1, 2, 3, 1)
col_names <- c("Q1", "Q2", "Q3", "Q5")
debug_ascii(col_positions, widths, col_names)
[Package speedycode version 0.3.0 Index]