Dear R-Studio users,
I am new in the world of shiny and I would like to use to call some Linux commands such as wget. It does not seem work, any idea ?
The user enters an url and shiny should start wget with the url.
ui.R
# Define UI for application that plots random distributions
shinyUI(basicPage(
textInput("file", "Url or File", "Url or File"),
submitButton("Update View", icon("refresh")),
helpText("When you click the button above, you should see",
"the output below update to reflect the value you",
"entered at the top:"),
verbatimTextOutput("value")
))
server.R
library(shiny)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
# submit buttons do not have a value of their own,
# they control when the app accesses values of other widgets.
# input$num is the value of the number widget.
#
values <- reactiveValues(variable = "Nothing loaded yet")
observe({
if(input$submit > 0) {
fn <- isolate(input$file)
values$variable <- system(paste0("wget ",input$file),intern=TRUE)
}
}))
output$value <- renderText({values$variable})
})