So I am using Rstudio, I am trying to include in my code that will allow the user to import that data. Currently, I am using file.choose() and read_xls(). The issue that arises is that most of the files that the user will input will have several worksheets and I only want to have it pull in the correct worksheet. So I am trying to find the source code or a function that will allow me to basically have a window pop up on the users screen similar to the one that Rstudio has in the file menu. If anyone knows of how to go about doing this, the source code, or a function/package that will allow me to do this, and advice would be greatly appreciated.
Asked
Active
Viewed 39 times
0
-
SamEdeus, what I think you're asking for is a modal window with a drop-down selection, offering the choice of available sheets. The `tcltk` package (included in R) has some capability for this, albeit not always "buttery-smooth looking"; see https://r.789695.n4.nabble.com/Dropdown-boxes-in-tcltk-and-R-td825110.html for a working example of a dropdown. Having said that, this question is asking us to *"recommend or find a book, tool, software library"*, which is [off-topic](https://stackoverflow.com/help/on-topic) on SO, so I suspect the question might be closed as such. – r2evans Sep 19 '19 at 14:58
-
Given that starting-hint, if you attempt the code at that link and cannot get it to work, please consider providing a minimal working example. A simple example might include: (1) programmatically build a workbook with two worksheets (perhaps with the `openxlsx` package); (2) read that file to find the number of sheets; (3) generate, use, and read from the popup. Some good examples of how to ask a good reproducible question: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Sep 19 '19 at 15:00