warning: error in as.double: cannot coerce type 's4' to vector of type 'double'

Hi, welcome!

We don't really have enough info to help you out. To help us help you, could you please prepare a reproducible example (reprex) illustrating your issue? Please have a look at this guide, to see how to create one for a shiny app

Dear all,
Here there is a complement of information: the log file related to the warning:
error in as.double: cannot coerce type 's4' to vector of type 'double'
https://www.cjoint.com/c/IJwn7iizkjv
Drfrangipane

Good afternoon,
there is no personal information
1- After deploying the application on shinyapps.io.
##Deployment completed: https://drfrangipaneee.shinyapps.io/shiny/
#from the log file :

Error in as.double: cannot coerce type 'S4' to vector of type 'double'

also i found a little mistake with your option : options(shiny.error = browser)

#Called from: (function (e)
#{

if (inherits(e, "shiny.silent.error"))

return()

handle <- getOption("shiny.error")

if (is.function(handle))

handle()

#})(list(message = "attempt to select less than one element in integerOneIndex",

call = liste_PMSI[[i]] <- list(finess = unique(data_unique$code.geo.resid)[i],

data = data2, polygon = SpatialPolygons(list()))))

2 - here there are links to obtain the following files: codes and data sample
=>ui.R https://www.cjoint.com/c/IJFr7LZGEfv
=>server.R (with comments ) https://www.cjoint.com/c/IJFsbfQogzv
=>data csv utf-8, 37 lines https://www.cjoint.com/c/IJFsc7QNHrv
=>A shape file (region ID 31) : in UTF-8 https://www.cjoint.com/c/IJFtiRRmhQv
==>
3-output figure in local before sharing application on shinyapps.io
https://www.cjoint.com/c/IJFtLHRhXDv

It's very unlikely that some one is going to put all this pieces together so they can take a look into your issue, you would have better chances by providing a minimal self-contained reproducible example.

Hi, thank you very much for your invitation to test my code through reprex library. It is a very good tool; I put you the focused issue later in the day. I pointed the issue with reprex().

Just to clarify, I'm not talking about the reprex package, because you can't use it for shiny apps, I'm talking about a reproducible example as explained in the link I gave you before.