使用R Rook包处理数据

时间:2017-01-17 19:36:51

标签: r csv rook

有没有人知道如何添加数据表,运行一些算法并使用R Rook应用程序保存答案?我在应用程序中读取数据时遇到问题。

我应该在Rook.app_2函数或data <- read.csv(file = "BASE_CASE.csv" )函数中编写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/

0 个答案:

没有答案