"The previous R session was abnormally terminated due to an unexpected crash"

Hello, I'm new to R. While trying to assign an Excel file to a data name using the read_excel function, something like data <- read_excel("data.xlsx"), I keep getting the above message. My Excel file has over 1 million rows of data. Could this be the reason?

Hi.
If you are using rstudio, it might be worth restarting it.
You can also try openxlsx, an R package that can read and write xlsx, but readxl is read only.

Thanks. Restarting RStudio doesn't seem to help. Sometimes I get the abnormally terminated message, sometimes the project goes to sleep when opening the file takes too long (more than ~30 seconds). I've edited my initial post, the file contains 1 million rows of data.

Hi, welcome to the forum.

Can you read the file into R without using RStudio? What happens if you try running R from a terminal or from a GUI in Windows?

You might also consider saving the file as a .csv file and trying to read it in with read.csv() or for something faster fread() from the {data.table} package.

Thank you jrkrideau. Everything is fine if I use RStudio desktop; I was using the cloud version before.

About using the .csv file, I get a message in the .csv file after opening it in Excel saying that I would lose data. That's why I worked with the .xlsx file instead. Also, I did some data cleaning inside Excel prior to analysis using R, and thought working in .xlsx would be better. Any advice on better ways of doing this would be very helpful.

Aha, we got it! Never trust Excel!

Quite seriously, storing data in Excel or on other spreadsheet is dubious and can result in data corruption

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.