Re: [问题] shiny相关问题

楼主: s86116 (hsiuy)   2015-07-16 02:15:04
※ 引述《s86116 (hsiuy)》之铭言:
: [问题类型]:
: 我想用R 都shiny写一个上传档案的app,但是我不知道要怎么用R 写出来。
: [软件熟悉度]:
: R基本的语法可以但shiny套件太新,所以很生疏。
: [问题叙述]:
: 我想用R 都shiny写一个上传档案的app,但是我不知道要怎么用R 写出来。已经把shin
y.rstudio.com中gallery提供的程式复制到rstudio了,但还是跑不出来。麻烦各位帮帮
忙了!
: [程式范例]:
: library(shiny)
: ui<-fluidPage()
: server<-function(input,output){}
: shinyApp(ui=ui,server=server)
: 以上的程式是没有问题的
: 视窗也有跑出来
: 但下面的程式就卡住了
程式来源
http://shiny.rstudio.com/gallery/file-upload.html
http://i.imgur.com/fwWA1Sr.jpg
http://i.imgur.com/wzHYHhg.jpg
: library(shiny)
: shinyUI(fluidPage(
: titlePanel("Uploading Files"),
: sidebarLayout(
: sidebarPanel(
: fileInput('file1', 'Choose CSV File',
: accept=c('text/csv',
: 'text/comma
-s
: '.csv')),
: tags$hr(),
: checkboxInput('header', 'Header', TRUE),
: radioButtons('sep', 'Separator',
: c(Comma=',',
: Semicolon=';',
: Tab='\t'),
: ','),
: radioButtons('quote', 'Quote',
: c(None='',
: 'Double Quote'='"',
: 'Single Quote'="'"),
: '"')
: ),
: mainPanel(
: tableOutput('contents')
: )
: )
: ))
: library(shiny)
: shinyServer(function(input, output) {
: output$contents <- renderTable({
: # input$file1 will be NULL initially. After the user selects
: # and uploads a file, it will be a data frame with 'name',
: # 'size', 'type', and 'datapath' columns. The 'datapath'
: # column will contain the local filenames where the data can
: # be found.
: inFile <- input$file1
: if (is.null(inFile))
: return(NULL)
: read.csv(inFile$datapath, header=input$header, sep=input$sep,
: quote=input$quote)
: })
: })
: [环境叙述]:
: 我是用rstudio跑的
: [关键字]:
: 选择性,也许未来有用
: 因为我平常不用ptt,这是我朋友的帐号,方便的话可以用line联络我,我的ID是jingc
hi
: ,问题解决了会很有诚意的请你吃个饭,真的拜托大家了!

Links booklink

Contact Us: admin [ a t ] ucptt.com