Putting together a shiny app

Yes, check your function and make sure that it works as intended, I can't give you any specific advice about this since I can't test your function (you have not provided a REPRoducible EXample (reprex) or sample data).