-1

UPDATED

I created one shiny app. there end user can run their Function(R Script). I enabled those things over this function(below)

server.R observeEvent(input$v1,{ inFile <- input$v1 if (is.null(inFile)) return(NULL) })

ui.R

fileInput('v1', 'End user function only in R script',accept=c('R/ R script','.R'))

above both codes are only small pieces. i want to run my separate R file over browsing Here that codes are not sourced. i want to get that function inside my shiny app and plot in my graph.

My problem is whole things working normally in my local host, I deployed this same app in shinyapp.io after that the end user part is not working(not whole app) I am stuck with this past three days! Guys is it possible to do?? Can any one help me?? I hope you Guys understand this. if not sorry!!!

Thanks in advance

Sarath_Mj
  • 323
  • 1
  • 2
  • 14
  • Please provide us your codes to reproduce – Chris Nov 29 '16 at 07:26
  • @Chris is it possible to do?? – Sarath_Mj Nov 29 '16 at 10:07
  • [This link](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) should get you started. The important part here is to come up with a minimal example that reproduces your issue. In addition to us seeing your issue, this will probably already help you better pinpoint the exact problem (and potentially solve the issue yourself already). – Paul Hiemstra Nov 29 '16 at 10:26
  • Chris @Paul Hiemstra , I changed the content. I hope you guys will understand this now. – Sarath_Mj Nov 29 '16 at 13:12

1 Answers1

1

I found the answer my self:

Include load() function in server page and get sourced the external file over load button.

inside the server code like this.

load_Rdata <- function(){
  if(is.null(input$file)) return(NULL)
 inFile <- isolate({ input$file })
source(inFile$datapath)
}

call this function inside the observe event

observeEvent(input$btnLoad,{ load_Rdata() }) `

UI code like this

fileInput("file", label = "Rdata"), actionButton(inputId="btnLoad","Load")

get the file over fileInput and source the file using load button to call load_Rdata to source file..

Sarath_Mj
  • 323
  • 1
  • 2
  • 14