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

"Unable to find 5 lines with expected number of columns" warning when freading 16 lines #1124

Closed
richierocks opened this issue Apr 21, 2015 · 5 comments
Assignees
Milestone

Comments

@richierocks
Copy link

When calling fread on a file with exactly 16 lines, I get the warning "Unable to find 5 lines with expected number of columns (+ last)".

To reproduce:

library(data.table)
n <- 16
d <- data.table(
  x = 1:n,
  y = letters[1:n]
)

lines <- c(
  paste(colnames(d), collapse = ","), 
  paste(d$x, d$y, sep = ",")
)
(lines <- paste(lines, collapse = "\n"))
## [1] "x,y\n1,a\n2,b\n3,c\n4,d\n5,e\n6,f\n7,g\n8,h\n9,i\n10,j\n11,k\n12,l\n13,m\n14,n\n15,o\n16,p"
fread(lines)

If you change n to 15 or 17, the warning does not occur.

@skatastic
Copy link

Here's a real world example of this bug at play.

fread("https://www.misoenergy.org/Library/Repository/Market%20Reports/20150531_da_pbc.csv",skip=4)

@sanmai-NL
Copy link

I also suffered this bug today.

@pseemakurthi
Copy link

I encountered the same bug using 1.9.7 freadversion

@jangorecki
Copy link
Member

@pseemakurthi did you try latest development version? optionally provide output of read.dcf(system.file("DESCRIPTION", package="data.table"), c("Packaged","Built"))

@arunsrinivasan
Copy link
Member

arunsrinivasan commented May 26, 2016

This has been fixed in the devel version. Please try it and post a new issue if you still get the warning.

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

No branches or pull requests

6 participants