Skip to content

fread with single line text #4689

@trainormg

Description

@trainormg

When calling fread with the text="content,to,parse" the behaviour is not as expected if the value is a string without a newline.
In that case, the value of text= is interpreted as a file name, the same behaviour of the input= parameter.

Example:

> fread(text = "a,b,c")
Error in fread(text = "a,b,c") : file not found: a,b,c 

I expected a data.table with three columns (a, b, c) and no rows, or a data.table with one row and columns V1, V2, V3, depending on the value of col.names.

R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions