有谁知道如何使用 R Rook 应用程序添加数据表、运行一些算法并保存答案?我在我的应用程序中读取数据时遇到问题。
我应该在哪里写 data <- read.csv(file = "BASE_CASE.csv" )
Rook.app_2 函数或write.data.HMTL
函数以及如何写?以下是我的应用程序功能的代码:
Rook.app_2 <- function(env) {
iter <<- iter + 1
request <- Request$new(env)
response <- Response$new()
# I believe that the problem is in line below
#I ve got this file in my working direction
data <- read.csv(file = "BASE_CASE.csv" )
## Add functionality to upload CSV-file
if (!is.null(request$POST())) {
## Read data from uploaded CSV-file
data <- request$POST()[["data"]]
data <- read.csv(data$tempfile)
}
write.initial.HTML(response, iter)
write.counting.HTML(request, response)
write.iris.HMTL(request, response, R.server)
write.data.HMTL(request, response, R.server)
write.final.HTML(response)
response$finish()
}
我将这个示例用于我的应用程序:https ://www.r-bloggers.com/a-simple-web-application-using-rook/