我正在使用 R 中的 Plumber API 创建 Web 应用程序。我试图使用管道工更改工作目录。
目前该文件在C:/xampp/htdocs/testMDA
我试图用C:\fileUpload\abc
. abc在函数中作为参数传递
library(plumber)
#* @get /string
getString <- function(get = ""){
dir <- setwd(file.path("C:/fileUpload/", get))
print(dir)
}
并输出我得到这是当前目录
"C:/xampp/htdocs/testMDA"