I want to apply my function in stat_function in ggplot2 and then use shiny to get an interactive figure. I tried my best. I struggled to do it as a newcomer to shinny. Here