全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
976 0
2016-12-21
在shiny提供的例子中,如何下载直方图?

library(shiny)# Define UI for application that plots random distributions shinyUI(pageWithSidebar(  # Application title  headerPanel("Hello Shiny!"),  # Sidebar with a slider input for number of observations  sidebarPanel(    sliderInput("obs",                 "Number of observations:",                 min = 1,                max = 1000,                 value = 500)  ),  # Show a plot of the generated distribution  mainPanel(    plotOutput("distPlot")  )))library(shiny)# Define server logic required to generate and plot a random distributionshinyServer(function(input, output) {  # Expression that generates a plot of the distribution. The expression  # is wrapped in a call to renderPlot to indicate that:  #  #  1) It is "reactive" and therefore should be automatically   #     re-executed when inputs change  #  2) Its output type is a plot   #  output$distPlot <- renderPlot({    # generate an rnorm distribution and plot it    dist <- rnorm(input$obs)    hist(dist)  })})
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群