Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

row column wrong in problems() with read_fwf #1524

Open
acdoering opened this issue Nov 27, 2023 · 0 comments
Open

row column wrong in problems() with read_fwf #1524

acdoering opened this issue Nov 27, 2023 · 0 comments

Comments

@acdoering
Copy link

Row column in data frame returned by problems() is wrong on results from read_fwf():

writeLines("15AB12\n161013\n161013\n17AC14\n18AB15", "testdata.txt")
x <- readr::read_fwf("testdata.txt", 
  col_types = "iii",
  col_positions = readr::fwf_widths(c(2,2,2), col_names = c("a", "b", "c")))
readr::problems(x)
# wrong, rows 1,2,2 with issues in col2 

# compare with read_csv():
writeLines("15,AB,12\n16,10,13\n16,10,13\n17,AC,14\n18,AB,15", "testdata.csv")
y <- readr::read_csv("testdata.csv", 
                     col_types = "iii",
                     col_names = c("a", "b", "c"))
readr::problems(y)
# correct, rows 1,4,5 with issues in col 2    

using R version 4.1.0, readr 2.1.3, vroom 1.6.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant