[datatable-help] fread(character string) limited to strings less than 4096 long?

Timothée Carayol timothee.carayol at gmail.com
Wed Mar 27 23:49:32 CET 2013


Agree with Muhammad, longer character strings are definitely permitted in R.

A minimal example that show something strange happening with fread:

for (n in c(1023:1025, 10000)) {
  A <- fread(
           paste(
                 rep('a\tb\n', n),
                 collapse=''
                 ),
           sep='\t'
           )
  print(nrow(A))
}

On my computer, I obtain:
[1] 1022
[1] 1023
[1] 1023
[1] 1023

Hope this helps
Timothée



On Wed, Mar 27, 2013 at 9:23 PM, Matthew Dowle <mdowle at mdowle.plus.com>wrote:

> Hi,
> Nice to hear from you. Nope not known to me. Obviously 4096 is 4k, is that
> the R limit for a character string length? What happens at 4097?
> Matthew
>
> > Hi,
> >
> > I have an example of a string of 4097 characters which can't be parsed by
> > fread; however, if I remove any character, it can be parsed just fine. Is
> > that a known limitation?
> >
> > (If I write the string to a file and then fread the file name, it works
> > too.)
> >
> > Let me know if you need the string and/or a bug report.
> >
> > Thanks
> > Timothée
> > _______________________________________________
> > datatable-help mailing list
> > datatable-help at lists.r-forge.r-project.org
> >
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/datatable-help
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20130327/ef676dcc/attachment.html>


More information about the datatable-help mailing list