Problems Importing specific sheets from Excel files with RStudio data import features

Hi,

I am having troubles for importing data from Excel which is not in the Default sheet. I was able to do this by using the RStudio data import features (Import Dataset --> From Excel) and selecting the desired sheet from the file. I neves had problems with this when using R 3.4 and RStudio 1.0.

However, now that I have updated R to 3.5 and RStudio to 1.1.456, when I try to select a sheet from the Excel file, the menu only shows the Default.

It is not a problem from readxl, as the following code works without problem:

Data <- read_excel("Mydata.xlsx", sheet = 2)

Thanks in advance for the help!

What operating system are you using? I wasn't able to reproduce this issue on macOS 10.13.6 with RStudio v1.1.456.

Does this occur for all kinds of worksheets, or just this specific one? Can you sample worksheet wherein you're seeing this erroneous behavior?

Hello Kevin,

Thank you very much for your reply. I am using Windows 10 Home, version 1803 with RStudio v1.1.456.

Trying to answer your question about if this happens with a specific worksheet or with all, I've been trying different things, and I believe I have found what the problem is. My native language is Spanish, so I have lots of folders with accents in their names (e.g. "Curso EstadĂ­stica"). Whenever I try to import an Excel worksheet that is inside a folder with an accent in its name, the sheet menu shows only the Default. If I copy the exact same Excel file to another folder without an accent in it's name, the menu shows all the sheets that the file has. I've tried this with different files and different folders, and it is what occurs.

When the filie is here C:/Users/letiv/Desktop/MyData.xlsx I can select the sheet without a problem.
When the file is here too: C:/Users/letiv/Desktop/Curso EP/MyData.xlsx
When the file is here: C:/Users/letiv/Desktop/Curso EP - EstadĂ­stica y R/MyData.xlsx I only see the default in the menu.

Thank you very much because you helped me find the problem with your question. Anyway, I think RStudio should enable import any Excel file, no matter where it is saves in the hard drive.

Cheers,

Leticia

1 Like

Thanks for the extra investigation! I'll file this as an issue for us to take a look at.

That is true Ividal. I was having the same problem as kevinushey, soI just removed the accents of my folders and it worked.

That's exactly what happened to me, a brazilian portuguese speaker. Below, the directory with special character that caused the problem

C:/Users/letiv/Desktop/EstatĂ­stica/Curso R/MyData.xlsx

Thanks for your help

It also happens on Linux: I tried to read from "~/tmp/data.xls" and it failed to find anything other than the default sheet, whereas "/home/goodale/tmp/data.xls" worked perfectly.