My server.R is below. When I try to make this (the mapurl) reactive to user input i see Error in as.vector(x, "character") : cannot coerce type 'closure' to vector of type 'character...error..
Is there anything that is wrong with the selectize parts?
shinyServer(function(input, output, session) {
mapurl <- reactive(mapurl <- session$registerDataObj(
name = 'Names',
iFile <- input$data1,
tFile <- read.table(iFile$datapath, header=TRUE, sep=input$sep, quote = ""),
filter = function(tFile, req){
query -> parseQueryString(req$QUERY_STRING)
ID = query$ID
finally = dev.off()
}))
output$contents <- renderTable({
inFile <- input$data1
if (is.null(inFile))
return(NULL)
read.table(inFile$datapath, header=TRUE, sep=input$sep, quote = "")
})
output$Plot <- renderPlot({ iFile <- input$data1
tFile <- read.table(iFile$datapath, header=TRUE, sep=input$sep, quote = "")
plot(c(1, 13), range(as.matrix(tFile)), type = 'n', xaxt = 'n', las = 1,
xlab = 'Experimental Points', ylab = 'Flux and Impact')
matlines(t(tFile), type = 'l', lty = 1, col = 'gray')
axis(1, 1:13, colnames(tFile))
})
updateSelectizeInput( session, "ID", server = TRUE, choices = setdiff(rownames(tFile)), options = list(render = I(sprintf( "{ option: function(item, escape) { return '' + escape(item.value) + ''; } }", mapurl ))) ) })