Open
Description
I will preface this with saying that I don't know if this is a good issue, and that I don't have a good solution.
When reading the documentation for read_delim()
, the delim
argument states:
Single character used to separate fields within a record.
for a second, I thought that you could only use single character strings as delim
but with some testing it found that it accept a length 1 character vector with any number of characters. I know this is kinda messy, but I wonder if the wording could be clarified
library(readr)
temp_f <- tempfile()
write_lines(
c("4-,45-,564-,4",
"4-,42-,534-,3",
"4-,45-,564-,1"),
temp_f
)
read_delim(temp_f, delim = "-,", col_names = FALSE)
#> Rows: 3 Columns: 4
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: "-,"
#> dbl (4): X1, X2, X3, X4
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 3 × 4
#> X1 X2 X3 X4
#> <dbl> <dbl> <dbl> <dbl>
#> 1 4 45 564 4
#> 2 4 42 534 3
#> 3 4 45 564 1
Created on 2022-12-04 with reprex v2.0.2