3

Sorry if I am not clear enough, this is my first question.

I am not able to read an .xz file using different functions from package readr. In different parts of my code I have the following lines:

dat <- read_lines(filename, progress = F, n_max = 1999999)

dat <- read_fwf(filename, 
                fwf_widths(c(1, 10, 18, 15, 15, 15, 12, 15, 15, 15, 1)), 
                col_types = 'iiddddddddi', 
                progress = T)

Both of them produce a crash, with no error message (but "R encountered a fatal error..."). File is pretty big (>1Gb compressed), but RAM is around 35% when crashing (using Windows 7).

When working on uncompressed files (>10Gb) everything runs smoothly. Of course I could uncompress the files before reading but I would like to understand what's happening.

Any clue?

Andrew Brēza
  • 7,705
  • 3
  • 34
  • 40
Vecino
  • 41
  • 5
  • Does library(archive) perhaps work to read in the csv within your xz archive, cf my answer here https://stackoverflow.com/questions/7044808/using-r-to-download-gzipped-data-file-extract-and-import-data ? – Tom Wenseleers Jul 11 '22 at 16:14

0 Answers0