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

readxl
rstudio

#1

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!


#2

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?


#3

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


#4

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


#5

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