Is there an R command to trigger the download of a file from Rstudio Server?

╄→гoц情女王★ 提交于 2020-02-21 03:14:51

问题


When working with Rstudio Server, it is very easy to download a file from the server with File>More>Export... The web browser will automatically start downloading.

Is there a way to generate this download with an R command ?


回答1:


Does browseURL do it for you:

browseURL                package:utils                 R Documentation

Load URL into a WWW Browser

Description:

     Load a given URL into a WWW browser.

Usage:

     browseURL(url, browser = getOption("browser"), encodeIfNeeded = FALSE)

That should fire it up in a browser. To download directly in R, download.file is what you want, but that hangs the command line until complete.



来源:https://stackoverflow.com/questions/11649224/is-there-an-r-command-to-trigger-the-download-of-a-file-from-rstudio-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!