problem using validate ()

1,555 views
Skip to first unread message

Ginger Harvest

unread,
Nov 24, 2015, 5:53:33 PM11/24/15
to Shiny - Web Framework for R

Hi all, 

I tried to use the function "validate" with rCharts' renderChart2 but it showed the error message "Error : is.character(txt) is not TRUE".
I tried to use "validate" in different render functions, the same error showed.  

The R code involved is simple and listed below:

output$new_rCharts <- renderChart2({
  
  validate(
    # need (TRUE, message = FALSE) 
    need (input$x, message = FALSE)
  )
  ...

})

I googled this issue and found one mentioned about using up-to-date packages. 
I am not sure what package needs to be updated so I have listed some output from sessionInfo below:

> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.10.3 (Yosemite)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] psych_1.5.8         IRT_0.0.9.9000      plyr_1.8.3          rCharts_0.4.5       XLConnect_0.2-11   
 [6] XLConnectJars_0.2-9 rhandsontable_0.2   ATA8_1.0.0          psyVis_0.0.5.99     reshape_0.8.5      
[11] ggplot2_1.0.1       rmarkdown_0.7       taRifx_1.0.6        D3TableFilter_0.5   htmlwidgets_0.5    
[16] shinyBS_0.61        shinyjs_0.1.0       jsonlite_0.9.17     DT_0.1              ggvis_0.4.2        
[21] shiny_0.12.2  

Thanks. 

Ginger

Joe Cheng

unread,
Nov 25, 2015, 1:02:27 PM11/25/15
to Ginger Harvest, Shiny - Web Framework for R
I could be wrong but I suspect the error is not coming from validate but somewhere else. If you install the latest GitHub version of Shiny, you will get detailed stack traces when an error occurs: devtools::install_github("rstudio/shiny"), then restart R. Can you try that and reply with the stack trace? Thanks.

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/718b0e99-ba08-4580-b956-fb43daa1d97c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin Little

unread,
Nov 27, 2015, 5:09:47 PM11/27/15
to Shiny - Web Framework for R
Ginger, I had the same issue this week, also using shiny::validate in an app that requires jsonlite..  

Check the order of your loading packages and whether you get a warning message that shiny::validate is masked by jsonlite::validate.

The validate function in jsonlite is expecting a single argument text string, not the arguments of shiny::validate (and that matches the error message you report).  Loading the shiny package after the jsonlite package will get you the validate function in shiny.    Or explicitly change the function call to explicitly reference the shiny package as shiny::validate

Joe Cheng

unread,
Nov 28, 2015, 2:04:06 PM11/28/15
to Kevin Little, Shiny - Web Framework for R
Oh, ouch :(

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.

siddhanth chandrashekar

unread,
Jul 29, 2016, 6:29:42 AM7/29/16
to Shiny - Web Framework for R
Thanks Kevin! You saved me a ton of trouble!
Message has been deleted

Ian Lyttle

unread,
Feb 26, 2017, 2:00:54 PM2/26/17
to Shiny - Web Framework for R
Kevin,

This was exactly the error that I spent a good part of my morning tracking down (before turning to Google). You saved me a *ton* of time.

Thanks so much for posting this!

Reply all
Reply to author
Forward
0 new messages