これは、私はこのコードを持っている光沢のあるアプリケーションに関する: データモデルは次のとおりです。R:CBINDフォーマットとして使用csvファイル
2 \t 3 \t 4 \t 4 \t 2
6 \t 2 \t 3 \t 1 \t 0
4 \t 1 \t 1 \t 0 \t 4
3 \t 2 \t 2 \t 3 \t 5
2 \t 3 \t 5 \t 4 \t 0
1 \t 2 \t 2 \t 2 \t 1
5 \t 5 \t 0 \t 3 \t 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データを使用) – user2870763
csvファイルがどのように表示されるかの例がないので、わかりにくいです。 –