R shine上传一个.rda文件

时间:2015-03-13 13:53:56

标签: r shiny rda

我无法上传并显示一个rda文件,其中的库在R中闪亮。 有人知道怎么做吗? 我使用R版本3.1.1。 以下是使用闪亮的网站:http://shiny.rstudio.com

**

#ui.R
library(shiny)
shinyUI(navbarPage("MareyMap online",

                   tabPanel("Présentation",

h2("A web-service for estimating recombination rates along the genome",align="center"),

br()

),

tabPanel("Step 1 : Data Selection",


         fileInput("file", label = h3("or upload a data set")),
                         'Note: Upload the marey map data for your species using the following format: txt, rda,
Rda, rdata or Rdata.',

        "Optional -- Would you agree to include your dataset in our database after data curation",

         tableOutput("table")

         )
))
#server.R
library(shiny)
library(MareyMap)
shinyServer(function(input, output) {

  output$table <- renderPrint({
    input$file
  })  
})

**

1 个答案:

答案 0 :(得分:0)

它没有用,但最后我尝试使用.txt文件:

&#34;设置&#34; &#34;映射&#34; &#34; MKR&#34; &#34;物理层&#34; &#34;根&#34; &#34; VLD&#34; &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP131&#34; 184351 0是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP5&#34; 189722 2.61是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP247&#34; 662031 2.54是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; GST1&#34; 663291 3.99是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP151&#34; 1148355 3.35是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; AtEAT1&#34; 1435872 3.87是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; ve002&#34; 1521308 7.15是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP388&#34; 1526933 7.66是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP170&#34; 1642565 7.66是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; ve003&#34; 2032443 7.76是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP308&#34; 2664435 0.89是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34;的phyA&#34; 3097714 11.35是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP107&#34; 3097951 11.86是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP138&#34; 3121108 14.69是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP270&#34; 3190609 13.8是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; ve005&#34; 3194953 11.48是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; nga63&#34; 3224435 11.48是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; ARR4&#34; 3443848 11.35是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP148&#34; 3658292 11.99是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; BFN1&#34; 3773426 11.98是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; NCC1&#34; 4107626 12.6是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; ve006&#34; 4459553 16.13是的 &#34; Arabidopsis thaliana&#34; &#34;染色体1&#34; &#34; SGCSNP132&#34; 4588103 14.04是的 ...

server.R

库(有光泽) 库(MareyMap)

shinyServer(函数(输入,输出){

输出$ table&lt; - renderPrint({

#data(Arabidopsis_thalianan)
#Arabidopsis_thalianan@maps  

})

输出$ table2&lt; - renderTable({

inFile <- input$file

if (is.null(inFile))
  return(NULL)

read.csv(inFile$datapath, header = TRUE,
         sep = ' ', quote ='"')

})

输出$ table3&lt; - renderTable({

inFile <- input$file

if (is.null(inFile))
  return(NULL)

a<-read.csv(inFile$datapath, header = TRUE,
         sep = ' ', quote ='"')
a[,"map"]

})

})

ui.R

库(有光泽)

shinyUI(navbarPage(&#34; MareyMap online&#34;,

               tabPanel("Présentation",

                        h2("A web-service for estimating recombination rates along the genome",align="center"),


                        br(),

                        helpText("MareyMap allows to estimate local recombination rates along the genome. MareyMap relies on
                                 comparing the genetic and the physical maps of a given chromosome to estimate local recombination
                                 rates (given by the slope of the curve describing the relationship between both variables), a graphical
                                 method called the Marey map method introduced by A. Chakravarti in 1991 . MareyMap accepts Marey
                                 map data as input (genetic and physical positions of markers for a set of chromosomes of a species) and
                                 will return local recombination rate estimates.")
                        ),



               tabPanel("Step 1 : Data Selection",

                        selectInput("dataset", label = h3("Select a dataset in our database",align="center"),
                                    choices = c("Arabidopsis_thalianan", "Caenorhabditis_elegans" ,
                                                "Drosophila melanogaster","Homo sapiens")),

                        fileInput("file", label = h3("or upload a data set")),
                        'Note: Upload the marey map data for your species using the following format: txt',

                        br(),
                        br(),

                        "Optional -- Would you agree to include your dataset in our database after data curation",

                        textOutput("table"),
                        tableOutput("table2")


               ),
               tabPanel("Step 2 : Data curation",
                        "list of chromosomes:",
                        br(),
                        tableOutput("table3")
               ),
               tabPanel("Step 3 : Interpolation"),
               tabPanel("Step 4 : Rec Rates export")
                        ))

但我不能只显示地图列。