Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file.choose() opens dialogue without file names on Windows

Tags:

windows

r

rstudio

When I use file.choose or choose.files to select a file, the dialogue window shows folder icons but no text.

Blank Window

This problem did not occur previously. I did update RStudio not too long ago, but I am not sure if that is the cause. I am currently using R 4.1.1 and RStudio 2023.03.0 Build 386.

file.choose is in base and choose.files is in utils, so they should both be up to date. I see this behavior even in a new R process with no additional packages loaded, so I know that I am calling the functions in base R.

like image 894
bmacwilliams Avatar asked Sep 16 '25 22:09

bmacwilliams


1 Answers

As no one has yet answered this question by putting the working solutions in an answer instead of a comment, I will copy some and add more possible solutions for @Faemaika who seems to have the same problem, but for who the stated solutions do not help.

Firstly, as Mikael Jagan stated, try running base::file.choose() from the command line, rather than from RStudio. If this works well, try upgrading R to the latest version. It should be at least 4.3.0, but at the moment of writing we are in R 4.3.1 for which it should work too. Then, file.choose and choose.files are up to date enough.

Secondly, if this does not work, open the app 'file explorer' and keep it open while using the file.choose function in RStudio.

Thirdly, if the problem still persists, check if your RStudio file chooser is currently located to a path which is accessible. If you last opened a file to which the path is now depricated, the file chooser might struggle with opening any path at all. You can solve this by manually opening a random file by using Ctrl + O and clicking some random file. Then retry file.choose.

Fourthly, you might consider to reboot your pc/RStudio. This may work only after multiple times; do not give up too soon.

Good luck!

like image 182
Marja van der Wind Avatar answered Sep 19 '25 11:09

Marja van der Wind