From 0228e84f69ca5bc07e1632582ff44d16ee1a6ab1 Mon Sep 17 00:00:00 2001 From: Andre Chalom Date: Wed, 1 Jul 2015 14:14:08 -0300 Subject: [PATCH] Removing install button --- server.R | 37 ++++++++++++++++++++----------------- ui.R | 16 ++++++++-------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/server.R b/server.R index bfb83be..7a79bbe 100644 --- a/server.R +++ b/server.R @@ -126,19 +126,20 @@ shinyServer(function(input, output, session) { replace=isolate(input$replace)) }) ### tries to install the Rsampling package - output$pkginstall <- renderText({ - # runs when the install button is pressed - if (input$installbutton > 0) { - if(!require(devtools)) - install.packages("devtools") - library(devtools) - install_github(repo = 'lageIBUSP/Rsampling') - if(require(Rsampling)) - return("Installation complete!") - else - return("Installation error!") - } - }) + # Removed in v1.1 because of several issues +# output$pkginstall <- renderText({ +# # runs when the install button is pressed +# if (input$installbutton > 0) { +# if(!require(devtools)) +# install.packages("devtools") +# library(devtools) +# install_github(repo = 'lageIBUSP/Rsampling') +# if(require(Rsampling)) +# return("Installation complete!") +# else +# return("Installation error!") +# } +# }) ########################################### ####### OUTPUT GENERATING FUNCTIONS ####### ########################################### @@ -177,10 +178,12 @@ shinyServer(function(input, output, session) { }) ### Updates the values in the dropdowns for column selection observe({ - # Check to see if there is any data (may fail during file upload) - if(!ncol(data())) return(); - cols <- 1:length(colnames(data())) - names(cols) <- colnames(data()) + # Check to see if there is any data (may fail during file upload + # or if Rsampling is not installed) + d <- tryCatch(data(), error=function(cond) return(data.frame())) + if(!ncol(d)) return(); + cols <- 1:length(colnames(d)) + names(cols) <- colnames(d) updateSelectInput(session, "m1", choices = cols) updateSelectInput(session, "r1", choices = cols) updateSelectInput(session, "r2", choices = cols, selected=2) diff --git a/ui.R b/ui.R index ebd3017..3598ea3 100644 --- a/ui.R +++ b/ui.R @@ -8,14 +8,14 @@ shinyUI(fluidPage(theme= "bootstrap.css", includeHTML("help.html"), h3("Package installation!"), conditionalPanel( # for Rsampling install - p("It seems that you don't have the Rsampling package installed. You can install it - by pressing the button below (experimental!), and it should take a couple of minutes - to download and install. If it fails, see the instructions for manual install ", - a("here", href="https://github.com/lageIBUSP/Rsampling")), - actionButton("installbutton", "Install!"), - conditionalPanel(condition="input.installbutton > 0", - textOutput("pkginstall") - ), + p("It seems that you don't have the Rsampling package installed. Please install it + following the instructions ", + a("here", href="https://github.com/lageIBUSP/Rsampling"), ", then reload this interface", + style="color:#f30"), +# actionButton("installbutton", "Install!"), +# conditionalPanel(condition="input.installbutton > 0", +# textOutput("pkginstall") +# ), condition="output.needinstall" ), conditionalPanel("!output.needinstall",