Skip to content

add fread support for text= single line without \r or \n#4703

Merged
mattdowle merged 7 commits intoRdatatable:masterfrom
ben-schwen:fread_text_single_line
Aug 18, 2021
Merged

add fread support for text= single line without \r or \n#4703
mattdowle merged 7 commits intoRdatatable:masterfrom
ben-schwen:fread_text_single_line

Conversation

@ben-schwen
Copy link
Copy Markdown
Member

Closes #4689. fread(text = "a b c") works now and produces an data.table with 0 rows and 3 cols. Beforehand this resulted in an error because single line text without \r or \n was treated like fread(input = text).

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 11, 2020

Codecov Report

Merging #4703 (3328f68) into master (1b87849) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4703      +/-   ##
==========================================
- Coverage   99.51%   99.51%   -0.01%     
==========================================
  Files          76       76              
  Lines       14696    14694       -2     
==========================================
- Hits        14625    14623       -2     
  Misses         71       71              
Impacted Files Coverage Δ
R/fread.R 100.00% <100.00%> (ø)
src/freadR.c 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b87849...3328f68. Read the comment docs.

Comment thread R/fread.R Outdated
@mattdowle mattdowle added this to the 1.14.1 milestone Aug 18, 2021
@mattdowle mattdowle merged commit cf51cae into Rdatatable:master Aug 18, 2021
@ben-schwen ben-schwen deleted the fread_text_single_line branch October 1, 2021 22:22
@torbjorn
Copy link
Copy Markdown

torbjorn commented Oct 13, 2022

Is this really fixed? I'm seeing this with 1.14.2:

    > packageVersion("data.table")
    [1] ‘1.14.2’
    > fread(text="a,b,c\n", header=F)
       V1 V2 V3
    1:  a  b  c
    > fread(text="a,b,c", header=F)
    Error in fread(text = "a,b,c", header = F) : file not found: a,b,c
    > 

@ben-schwen
Copy link
Copy Markdown
Member Author

ben-schwen commented Oct 13, 2022

@torbjorn this is fixed in the current dev-version. The added milestone might be misleading. You can update to the dev-version via data.table:::update.dev.pkg()

This will also not be fixed with 1.14.4 which was recently submitted to CRAN.

@mattdowle
Copy link
Copy Markdown
Member

mattdowle commented Oct 15, 2022

@ben-schwen @torbjorn once 1.14.4 is accepted on CRAN, I'll tag that in the patch-14.4 branch and then probably move forward with backporting bug fixes like this to 1.14.6 on that branch together with new features in dev that are stable and which shouldn't have any impact revdeps; e.g. the new env= argument.
The milestone does say 1.14.5 though so I'm not sure what's misleading there.

@ben-schwen
Copy link
Copy Markdown
Member Author

ben-schwen commented Oct 15, 2022

@mattdowle It's true once I click on the milestone or check the milestone below it says 1.14.5. In the timeline of commits, mentions and merges it is still displayed as 1.14.1 (see following image)
Screenshot_20221015_214158

@mattdowle
Copy link
Copy Markdown
Member

Thanks. Yes it's the same milestone that's since been renamed. Both the closed issue and the closed PR are marked 1.14.5 on the right though. Maybe in future then we should have a 'dev' or 'unstable' milestone and then move items to the release branch. Like R-devel does it.

@torbjorn
Copy link
Copy Markdown

It's 1.14.8 now and this seems not to be fixed:

> fread( text="hi,ho,silver", header=FALSE )
Error in fread(text = "hi,ho,silver", header = FALSE) : 
  file not found: hi,ho,silver

with a newline:

> fread( text="hi,ho,silver\n", header=FALSE )
   V1 V2     V3
1: hi ho silver

version:

> packageVersion("data.table")
[1] ‘1.14.8’

@ben-schwen
Copy link
Copy Markdown
Member Author

ben-schwen commented Mar 14, 2023

@torbjorn this is fixed in the current dev version. 1.14.2 - 1.14.8 were only small updates fixing things to keep it on CRAN, accommodate R dev version, etc. The milestone on the right also points towards 1.14.9

@jangorecki jangorecki modified the milestones: 1.14.9, 1.15.0 Oct 29, 2023
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

Successfully merging this pull request may close these issues.

fread with single line text

4 participants