shp file in the funtion

Hi @sbl_bah! Welcome!

I'm afraid there's not enough information here to know exactly why you're getting this error. Speaking very generally, the error is happening because varcode has the wrong length (it has length 2, here). I'm not at all sure I understand what varcode is supposed to be here, but it sounds like maybe you're expecting it to hold only a single value, rather than two values?

The next step is to work backwards to the code that calls this function and supplies the varcode argument to see why something unexpected is getting passed in. You might start by taking a look at the debugging resources linked here: Shiny debugging and reprex guide

Beyond that, your best bet for getting more specific help is to construct a small reproducible example that has the same problem — see the guide above for some pointers on how to do that when working with shiny.

1 Like