# NOT RUN {
For ease of replicability, the examples here
come from generated data rather than data from
an ASCII file.
# }
# 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.
# }
# 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)
# }
Run the code above in your browser using DataLab