Skip to content

Commit

Permalink
Removing install button
Browse files Browse the repository at this point in the history
  • Loading branch information
andrechalom committed Jul 1, 2015
1 parent c4b593b commit 0228e84
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
37 changes: 20 additions & 17 deletions server.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 #######
###########################################
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0228e84

Please sign in to comment.