File browser in R

后端 未结 3 1076
别那么骄傲
别那么骄傲 2020-12-14 09:09

I need to write a small R script for people who never used R before that imports a file and does some things with it. I would like to minimize user input as much as possible

相关标签:
3条回答
  • 2020-12-14 09:27

    The tcltk package gives you tk_choose.files.

    If you want to go beyond file choosers then you can use the package to build user interfaces.

    0 讨论(0)
  • 2020-12-14 09:38

    The file.choose function performs this, eg:

    fname <- file.choose()
    
    source(file.choose())
    

    You may also want to look at choose.files (for multiple files) and choose.dir (for just selecting a directory path).

    0 讨论(0)
  • 2020-12-14 09:40

    It's worth mentioning rChoiceDialogs::rchoose.files. I'm not completely sold yet, but they advertise it as being completely cross platform and fixing the annoying problem common to choose.files and tk_choose.files of popping up behind other windows. See their vignette here.

    0 讨论(0)
提交回复
热议问题