Trouble using read_excel

Hi guys,
fair warning, I am quite new to R coding.

Basically, I am trying to load in a sheet from a xlsx file using the read_excel function from the readxl library (which, from what I've read online, is a standard and reasonably efficient way of doing so).

But it just never finishes loading, with the little red stop sign being up indicating that it is trying to read in the file, but I waited for about 5 minutes and still nothing happened. The sheet is about 3,000 rows and 5 columns, but I then tested with a file which is only 20 rows and 5 columns, and still I had the same issue. I will include some screenshots below, but I am concerned that maybe my computer just has really bad memory?

Any help would be appreciated, thanks heaps.

One problem could be that it is trying to print and that is taking lots of time. Save your output somewhere such as:

library(readxl)
setwd("blahblahblah")
dat_in <- read_excel("filename.xlsx", sheet=4) # this is the key so it's not printing out the object

Hi, thanks heaps for the reply!

I ended up trying this and it still doesn't seem to want to load :[
(I have no issue reading in equally sized csv files using read_csv by the way)

Also, here's a screenshot of an error that I've noticed popping up sometimes (depending on what arguments I include in the read_excel function)

Where columns is defined as c("string 1", "string 2", etc)

I managed to solve the issue by reinstalling Rcpp, I think for some reason Rcpp wasn't fully installed (which was leading to RStudio getting caught in loops when doing some external C++ stuff I believe). Thanks again for the help Steph!

1 Like

I was on my phone earlier and was going to get to my computer to say to reinstall that. Glad it worked out! Mark your own response as a solution to help anyone looking in the future.

1 Like

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.