Error: Using C stack too close to limit when viewing data frame tail

I have a 91.2 MB appt data frame containing 29255 cases of 51 variables.

When I tried to check its end using tail(appt) , I get an error

Error: C stack usage 20212630 is too close to the limit

I have no idea what to do to handle this. Any suggestions on what I can do?

As additional information, I have in memory at the same time several other variables of almost comparable size, including a character vector of 90.2 MB and a data frame of 42.3 MB of 77405 vol. x 60 variables. Calling tail for these two other variables did not cause any errors.

Edit: I narrowed down that the error only occurs when accessing the last line. those. appt[29254, ] excellent, appt[29255, ] throws an error.

+6
source share
1 answer

I had exactly the same error, but I managed to solve it by disabling quoting when reading in a data frame. For me, an error occurred while trying to tail (df).

It turns out that one of the lines in my text file had a \ character. You may encounter the same problem if your file has an โ€œorโ€ somewhere, since read.table counts this quotation mark in the default case.

Add the quote = "option to disable alltogether quotation. Example: read.table (filepath, quote =" ")

If this does not solve your problem, check some other parameters in the read.table file (for example, allowEscapes, sep, ...), as they may cause an error.

0
source

Source: https://habr.com/ru/post/981198/


All Articles