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

fread detect types algorithm - nrows #773

Closed
robocop-bob opened this issue Aug 19, 2014 · 2 comments
Closed

fread detect types algorithm - nrows #773

robocop-bob opened this issue Aug 19, 2014 · 2 comments
Assignees
Milestone

Comments

@robocop-bob
Copy link

Hi,

fread has probably an issue: not using nrows limit in detect types algorithm.

Example: file AAA.cvs has 619 rows. We are trying read rows from = 3 to 308 by option nrows=305 and skip=2 , 1 it is header. fread trying detect type without nrows limitation... See command log attached below.

Format example for rows: 3-308

AAA|BBB|CCC
1|2|3

Format example for rows: 309-617

ZZZ|YYY
1|2
> packageVersion("data.table")
[1] ‘1.9.3

Best regards
robert

fread("AAA.cvs" ,nrows= 305 ,skip= 2 ,sep="|" , ,colClasses=colClasses,verbose=T) 
# Input contains no \n. Taking this to be a filename to open
# File opened, filesize is 0.000 GB
# File is opened and mapped ok
# Detected eol as \r\n (CRLF) in that order, the Windows standard.
# Looking for supplied sep '|' on line 3 ('skip' has been supplied) ... found ok
# Found 11 columns
# First row with 11 fields occurs on line 3 (either column names or first row of data)
# All the fields on line 3 are character fields. Treating as the column names.
# Count of eol after first data row: 617
# Subtracted 1 for last eol and any trailing empty lines, leaving 616 data rows
# nrow limited to nrows passed in (305)
# Type codes: 41214111441 (first 5 rows)
# Type codes: 41214111441 (+middle 5 rows)
# Error in fread("AAA.cvs",  : ' ends field 9 on line 3 when detecting types: AAA|1111
@arunsrinivasan
Copy link
Member

Could you please provide "AAA.cvs"?

@arunsrinivasan
Copy link
Member

Doesn't error in v1.9.5 if nrow argument is provided (and is right). But still gives a warning. Just fixed it, will commit soon.

Update: DONE.

@arunsrinivasan arunsrinivasan self-assigned this Sep 17, 2015
@arunsrinivasan arunsrinivasan added this to the v1.9.6 milestone Sep 17, 2015
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

2 participants