ramnathv / rCharts

Interactive JS Charts from R
http://rcharts.io
Other
1.19k stars 654 forks source link

Attempt to apply non-function when showing Rickshaw graph? #204

Open tcash21 opened 11 years ago

tcash21 commented 11 years ago

runGist("https://gist.github.com/tcash21/6234591")

As soon as I switched from renderPrint() and showing text to renderChart2() and showing a chart, I receive an 'attempt to apply non-function' error on startup. Any ideas how I can get rid of that error?

ramnathv commented 11 years ago

I am unable to reproduce the error, and the chart shows up fine for me. I have been making frequent changes to rCharts, so can you try installing the dev branch from github and trying again to see if the error persists?

image

tcash21 commented 11 years ago

Just installed the dev branch and ran the gist again and I am able to produce the plots fine. However, in the console I see "Listening on port 8100 Error in eval(expr, envir, enclos) : attempt to apply non-function"

timelyportfolio commented 11 years ago

I think that is a shiny issue. Try to install the newest shiny with the rstudio CRAN.

Kent

On Aug 14, 2013, at 5:08 PM, tcash21 notifications@github.com wrote:

Just installed the dev branch and ran the gist again and I am able to produce the plots fine. However, in the console I see "Listening on port 8100 Error in eval(expr, envir, enclos) : attempt to apply non-function"

— Reply to this email directly or view it on GitHub.

stanstrup commented 10 years ago

I am having the same issue. Was any cause found? I get the error when the inputs (two selectInput) have not yet been set. This happens even if I catch the missing input and doing "return(NULL)" inside renderChart2. Could it be that showOutput doesn't like to be feed NULL?

btw this is not Rickshaw specific. I am using highcharts.

stanstrup commented 10 years ago

Ok I have confirmed the nature of the bug. If Instead of return NULL I do:

if(is.null(input$explore_sys2)) {p<-hPlot(y ~ x, data = data.frame(x=1,y=2), type = "scatter");return(p)}

The error disappears. So showOutput doesn't handle NULL like uiOutput. Can this be fixed or is there something else we can return to not display an output?

EDIT: Highcharts$new() can be returned instead of NULL.

sachinrawat1903 commented 7 years ago

I am getting the same error. and yes it's because i am returning null if the is input is null. renderchart() function can't handle it. Is there any solution available?