【发布时间】:2016-02-28 17:50:36
【问题描述】:
当我更改工作目录(例如,从 dir1 到 dir2)然后尝试使用 choose.files() 时,choose.files() 第一次运行它会转到 dir1。如果我取消并再次运行choose.files(),那么它将在 dir2 中打开。如何让choose.files() 在最新的工作目录中打开?
我遇到了
file.choose()的不同问题,所以我没有 能够使用该功能作为替代品
这是一个例子:
getwd() # say this is dir1
setwd(choose.dir()) # here I change the wd to dir2
getwd() # currently set to dir2
choose.files() # this opens in dir1
choose.files() # this time it opens in dir2
我希望能够使用此进程从当前工作目录中选择一个文件。欣赏任何想法。谢谢!
【问题讨论】:
-
对于 linux/mac 上的任何人,请注意
choose.files()是一个仅限 Windows 的函数。 -
文档中
choose.files的描述:使用 Windows 文件对话框以交互方式选择零个或多个文件的列表。所以@Dason 是对的。它仅适用于 Windows。
标签: r filechooser