請問如何讓head,summary,plot的資料全部顯示出來,資料總共有86列,請各位大大解答了
library(shiny)
library(plotly)
library(quantmod)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
dataset1<-eventReactive(input$submit,{
vars<-input$variables
if(input$dataset=="AQI"){
data1<- read.csv("aqi.csv",header=TRUE,sep=",")
} else data1<-read.csv("cancer.csv",header=TRUE,sep=",")
list(vars=vars,data1=data1)
})
output$vars<-renderUI({
if(input$dataset=="AQI"){
vars<-colnames(read.csv("aqi.csv",header=TRUE,sep=","))
} else vars<-colnames(read.csv("cancer.csv",header=TRUE,sep=","))
checkboxGroupInput("variables", label = "請選擇變數", choices = vars, selected = 1)
})
output$test<-renderPrint({
vars<-dataset1()$vars
data1<-(dataset1()$data1)
head(data1[vars])
})
output$summary<-renderPrint({
vars<-dataset1()$vars
if(length(vars)>=1){
data1<-dataset1()$data1
summary(data1[vars])
}#else return(NULL)
})
output$plot<-renderPlot({
vars<-dataset1()$vars
if(length(vars)>=2){
data1<-dataset1()$data1
plot(data1[vars])
}else return(NULL)
})
})