-
Notifications
You must be signed in to change notification settings - Fork 289
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior
Description
I would expect fwf_positions() to guess the value of end based on the value of start. If end is not specified, the best guess should be that end is lead(start)-1. Perhaps I misunderstand what arg=NULL means, but having end=NULL implies to me that end is optional. I believe that this function could be improved with some simple changes:
fwf_positions <- function (start, end, col_names = NULL) {
if(missing(end)){
end <- lead(start)-1L
}
col_names <- fwf_col_names(col_names, length(start))
tibble(begin = start - 1L, end = end, col_names = col_names)
}Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behavior