【发布时间】:2017-07-20 20:23:37
【问题描述】:
这涉及闪亮的应用程序我有这个代码: 数据模型是:
2 3 4 4 2
6 2 3 1 0
4 1 1 0 4
3 2 2 3 5
2 3 5 4 0
1 2 2 2 1
5 5 0 3 4
> #This function is repsonsible for loading in the selected file
> filedata_DM <- reactive({
> infile <- input$datafile
> if (is.null(infile)) {
> # User has not uploaded a file yet
> return(NULL)
> }
> read.csv(infile$datapath,header=FALSE) })
> performanceMatrix <- cbind(
> c(-120.0,-150.0,-100.0,-60,-30.0,-80,-45.0),
> c(-284.0,-269.0,-413.0,-596,-1321.0,-734,-982.0),
> c(5.0,2.0,4.0,6,8.0,5,7.0),
> c(3.5,4.5,5.5,8,7.5,4,8.5),
> c(18.0,24.0,17.0,20,16.0,21,13.0) )
# results
output$filetable_result <- renderPrint({
Electre_tri(performanceMatrix,
alternatives,
profiles,
profiles_names,
criteria,
minmaxcriteria,
criteriaWeights,
IndifferenceThresholds,
PreferenceThresholds,
VetoThresholds,
lambda=NULL)
})
我从闪亮应用程序中的输入中读取 csv 文件,例如 `fileInput("file", "File"),
现在我想在 cbind 函数中使用 csv 数据(表格)而不是给定数字!
非常感谢您的帮助。 `
【问题讨论】:
-
如果你要访问你读到的数据,我想用
filedata_DM()就行了? -
谢谢!但不起作用!问题是如何将 csv 文件转换为 cbind 函数中呈现的形式(使用 csv 数据作为向量)
-
由于我们没有 csv 文件的示例,因此很难判断。
-
我编辑了问题,请看代码