Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hmbotelho/shinyHTM
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Mar 14, 2019
2 parents 7fafa62 + 279bbe6 commit ba622c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 31 deletions.
40 changes: 10 additions & 30 deletions server.r
Original file line number Diff line number Diff line change
Expand Up @@ -169,40 +169,20 @@ shinyServer(function(input, output, session){
# 1. FILE INPUT #
################################################################



observeEvent(input$loadFileType, {

if(input$loadFileType == "Auto"){
updateRadioButtons(session, "loadDecimalSeparator",
label = h4("File format"),
choices = list("Auto detect" = "Auto", "Dot (.)" = ".", "Comma (,)" = ","),
selected = "Auto"
)
}

if(input$loadFileType == "csv"){
updateRadioButtons(session, "loadDecimalSeparator",
label = h4("File format"),
choices = list("Dot (.)" = "."),
selected = "."
)
}

if(input$loadFileType == "tsv"){
updateRadioButtons(session, "loadDecimalSeparator",
label = h4("File format"),
choices = list("Auto detect" = "Auto", "Dot (.)" = ".", "Comma (,)" = ","),
selected = "Auto"
)
}
if(input$loadFileType == "Auto") x <- list("Auto detect" = "Auto", "Dot (.)" = ".", "Comma (,)" = ",")
if(input$loadFileType == "csv") x <- list("Dot (.)" = ".")
if(input$loadFileType == "tsv") x <- list("Auto detect" = "Auto", "Dot (.)" = ".", "Comma (,)" = ",")
if(input$loadFileType == "xlsx") x <- list("Auto detect" = "Auto")

if(input$loadFileType == "xlsx"){
updateRadioButtons(session, "loadDecimalSeparator",
label = h4("File format"),
choices = list("Auto detect" = "Auto"),
selected = "Auto"
updateRadioButtons(session, "loadDecimalSeparator",
label = "Decimal separator",
choices = x,
selected = x[[1]]
)
}

})

observeEvent(input$file1, {
Expand Down
2 changes: 1 addition & 1 deletion ui.r
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ shinyUI(navbarPage("shinyHTM",
choices = list("Auto detect" = "Auto", "Comma separated (csv)" = "csv", "Tab separated (txt)" = "tsv", "Excel (xlsx)" = "xlsx"),
selected = "Auto"),
br(),
radioButtons("loadDecimalSeparator", label = h4("Decimal separator"),
radioButtons("loadDecimalSeparator", label = "Decimal separator",
choices = list("Auto detect" = "Auto", "Dot (.)" = ".", "Comma (,)" = ","),
selected = "Auto")
)
Expand Down

0 comments on commit ba622c6

Please sign in to comment.