I am Creating Web Application with Plumber API in R. I was trying to change the working directory using plumber.
Currently the file is in C:/xampp/htdocs/testMDA
i was trying to change the directory with C:\fileUpload\abc
. abc is passed as argument in function
library(plumber)
#* @get /string
getString <- function(get = ""){
dir <- setwd(file.path("C:/fileUpload/", get))
print(dir)
}
and output i get this which is current directory
"C:/xampp/htdocs/testMDA"
Try to avoid naming arguments like base functions (get in your function). I don't see where you use plumber in your example. What happens if you run the following code (assuming the folder "fileUpload" exists)? If it runs, you can insert it into your function.