error: argument is not interpretable as logical - ShinyRGL

2,654 views
Skip to first unread message

ForestCAS

unread,
Feb 10, 2014, 7:22:21 PM2/10/14
to shiny-...@googlegroups.com
Hi everyone,

I am try do a app with ShinyRGL and when I run the code the app show me this error: argument is not interpretable as logical
Does someone know why?

require(shiny)
require(shinyRGL)

runApp(list(
  ui = bootstrapPage(
    fileInput('inputdata', 'Input File',accept='.txt'),
    webGLOutput("rglplot")
    ),
  server = function(input, output) {
    
    output$rglplot <- renderWebGL({
      
      mydata<- input$inputdata
      if (is.null(mydata)) 
        return(NULL)       
      
      mydata1<-read.table(mydata$datapath, sep=",", header=T)
      
      require(rgl)
      plot3d(mydata1)
      
    })
  }
))


Thank you so much,
Best Regards
Carlos A. Silva
mydata.txt

Jeff Allen

unread,
Feb 11, 2014, 11:58:20 AM2/11/14
to shiny-...@googlegroups.com
I think this is a bug in ShinyRGL. If memory serves, ShinyRGL will try to plot whatever you return as a WebGL scene. So if you don't do something like plot3d() within your renderWebGL() function, it's not going to handle that case properly. It should check to see if you returned NULL before trying to plot the scene.

Feel free to open an issue here: https://github.com/trestletech/shinyRGL/issues and I'll take a look at this (hopefully) shortly.

Best,
Jeff

Jeff Allen

unread,
Feb 11, 2014, 12:14:43 PM2/11/14
to shiny-...@googlegroups.com
Oh, and the sloppy fix would be to create an empty 3D scene (like plot3d(1,1,1) ) inside your if (is.null) before returning. You can strip out the axes and things to create a blank scene, though I don't remember the parameters for rgl off the top of my head.

Tuesday, February 11, 2014 10:58 AM
I think this is a bug in ShinyRGL. If memory serves, ShinyRGL will try to plot whatever you return as a WebGL scene. So if you don't do something like plot3d() within your renderWebGL() function, it's not going to handle that case properly. It should check to see if you returned NULL before trying to plot the scene.

Feel free to open an issue here: https://github.com/trestletech/shinyRGL/issues and I'll take a look at this (hopefully) shortly.

Best,
Jeff

On Monday, February 10, 2014 6:22:21 PM UTC-6, ForestCAS wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shiny-discuss/-wQGbIqBQhQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

ForestCAS

unread,
Feb 11, 2014, 12:43:20 PM2/11/14
to shiny-...@googlegroups.com
Hi Jeff, 
Great! It works well! Thank you so much!
Best Regards
Carlos A. Silva

Reply all
Reply to author
Forward
0 new messages