读取闪亮的数据框

时间:2014-03-28 06:12:45

标签: r dataframe shiny


如果我提出太基本的问题,我对光明是全新的,请向我道歉 问题1:
如何读取闪亮的数据框?喜欢read.table。
这是我的代码:

ui.R
 fileInput('file1', 'Choose txt file:',
              accept=c('text', 'tab-separated-values'))
server.R
data1<-read.table(input$file1) # inside renderPlot

但这不起作用。我想以制表符分隔文件作为输入。

问题2:

如何在同一行中保留两个菜单选项,例如

fileInput('file1', 'Choose txt file:',
              accept=c('text', 'tab-separated-values')),

selectInput("M",  label= "Select M value:", 
                choices = 2:15)

如何在同一行显示上述项目,而不是一个以下项目?
提前谢谢!

1 个答案:

答案 0 :(得分:0)

对于csv data <-read.csv("data.csv",header=TRUE,sep="," ,quote='"') 对于制表符分隔文件read.table(file, header = TRUE, sep = "")我建议你创建一个global.R文件来读取数据而不是在函数中这样做