r – How to work date slider in shiny line plot

I have a shiny app where the user can choose a range of dates, a wilderness, a species, a life stage, and finally a site id. What should appear is a line plot with bd_load for each time point. However, my script for some reason will only show one data point for the year 2016 no matter what range of dates I choose.

Data

bd_data <- structure(list(id = c(10008, 10008, 10008, 10008, 10008, 10008, 
10008, 10008, 10008, 10011, 10011, 10011, 10011, 10011, 10011, 
10011, 10011, 10032, 10032, 10032, 10032, 10032, 10037, 10037, 
10037, 10037, 10037, 10037, 10037, 10037, 10037, 10037, 10037, 
10037, 10037, 10037, 10037, 10055, 10055, 10055, 10055, 10055, 
10055, 10055, 10055, 10055, 10055, 10055, 10055, 10055, 10055, 
10055, 10055, 10069, 10069, 10069, 10069, 10069, 10069, 10069, 
10069, 10081, 10081, 10081, 10081, 10081, 10081, 10081, 10081, 
10081, 10081, 10081, 10081, 10081, 10081, 10081, 10081, 10081, 
10090, 10090, 10090, 10090, 10090, 10090, 10090, 10090, 10090, 
10090, 10090, 10090, 10090, 10090, 10090, 10090, 10090, 10090, 
10090, 10090, 10090, 10090, 10090, 10090, 10090, 10091, 10091, 
10091, 10091, 10091, 10091, 10091, 10091, 10091, 10091, 10095, 
10095, 10095, 10095, 10095, 10095, 10100, 10100, 10100, 10100, 
10100, 10100, 10100, 10100, 10100, 10100, 10100, 10100, 10100, 
10100, 10100, 10100, 10100, 10100, 10100, 10100, 10100, 10100, 
10100, 10100, 10100, 10100, 10100, 10100, 10101, 10101, 10101, 
10101, 10101, 10101, 10101, 10101, 10101, 10101, 10101, 10101, 
10101, 10101, 10101, 10101, 10101, 10101, 10101, 10101, 10101, 
10101, 10101, 10101, 10102, 10102, 10102, 10102, 10102, 10102, 
10102, 10102, 10102, 10102, 10102, 10102, 10102, 10102, 10102, 
10102, 10102, 10102, 10102, 10102, 10102, 10102, 10102, 10102,
72442, 72442, 72463, 72463, 72463, 72466, 72472, 72476, 72476, 
72476, 72476, 72515, 72535, 72554, 72554, 72554, 72554, 72554, 
72579, 72579, 72579, 72598, 72667, 72667, 72667, 72667, 72695, 
72696, 72700, 72708, 72708, 72708, 72708, 72708, 72759, 72768, 
72787, 72787, 72796, 72808, 72808, 72808, 72808, 72808, 72808, 
72808, 72808, 72808, 72808, 72808, 72808, 72808, 72808, 72808, 
72808, 72808, 72808, 72808, 72812, 72828, 72828, 72849, 72851, 
72862, 72862, 72862, 72864, 72923, 72953, 72953, 72953, 72962, 
72973, 72973, 72973, 72974, 72974, 72974, 72974, 72986, 72986, 
72989, 72990, 72990, 72990, 72990, 72990, 72996, 72996, 72996, 
72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 
72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 
72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 
72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 72996, 
72996, 72998, 72998, 72998, 72998, 73005, 73005, 73013, 73037, 
73037, 73042, 74060, 74061, 74062, 74062, 74119, 74119, 74120, 
74141, 74141, 74143, 74143, 74143, 74143, 74151, 74156, 74165, 
74206, 74269, 74269, 74269, 74269, 74269, 74269, 74269, 74281, 
74281, 74281, 74281, 74281, 74281, 74281, 74281, 74281, 74281, 
74281, 74281, 74281, 74284, 74333, 74333, 74333, 74333, 74333, 
74335, 74335, 74335, 74335, 74976, 74976, 74976, 74976, 74976, 
74976, 74976, 74976), date = c(2005, 2005, 2006, 2006, 2007, 
2012, 2019, 2019, 2019, 2005, 2006, 2006, 2007, 2007, 2012, 2012, 
2012, 2012, 2012, 2019, 2019, 2019, 2005, 2005, 2006, 2006, 2006, 
2007, 2007, 2012, 2012, 2012, 2019, 2019, 2019, 2021, 2021, 2005, 
2005, 2006, 2006, 2007, 2010, 2010, 2012, 2012, 2012, 2017, 2017, 
2017, 2018, 2021, 2021, 2009, 2009, 2011, 2011, 2011, 2015, 2015, 
2016, 2007, 2007, 2009, 2009, 2009, 2011, 2011, 2011, 2012, 2012, 
2013, 2013, 2014, 2014, 2015, 2015, 2016, 2005, 2005, 2006, 2006, 
2006, 2007, 2007, 2009, 2009, 2010, 2010, 2010, 2011, 2011, 2011, 
2012, 2012, 2013, 2013, 2014, 2015, 2016, 2018, 2018, 2018, 2007, 
2009, 2011, 2011, 2012, 2012, 2013, 2013, 2014, 2015, 2011, 2012, 
2013, 2014, 2015, 2016, 2005, 2007, 2008, 2008, 2009, 2009, 2009, 
2011, 2011, 2011, 2011, 2012, 2012, 2013, 2013, 2014, 2015, 2016, 
2016, 2016, 2017, 2017, 2017, 2018, 2018, 2020, 2021, 2021, 2007, 
2007, 2008, 2008, 2009, 2009, 2011, 2012, 2012, 2013, 2013, 2014, 
2014, 2015, 2016, 2016, 2016, 2017, 2017, 2017, 2018, 2018, 2020, 
2021, 2005, 2005, 2007, 2007, 2008, 2008, 2009, 2009, 2011, 2011, 
2011, 2012, 2012, 2013, 2013, 2014, 2015, 2015, 2016, 2016, 2016, 
2017, 2017, 2018, 2018, 2020, 2021, 2008, 2008, 2012, 2013, 2013, 
2014, 2015, 2015, 2011, 2007, 2009, 2009, 2009, 2010, 2010, 2010, 
2011, 2011, 2011, 2012, 2012, 2013, 2013, 2014, 2014, 2016, 2016, 
2017, 2017, 2017, 2007, 2007, 2009, 2010, 2010, 2011, 2011, 2011, 
2012, 2013, 2013, 2014, 2016, 2016, 2007, 2007, 2009, 2009, 2009, 
2010, 2010, 2010, 2011, 2011, 2011, 2012, 2012, 2013, 2013, 2013, 
2014, 2014, 2016, 2017, 2009, 2010, 2010, 2011, 2012, 2013, 2014, 
2016, 2016, 2007, 2011, 2011, 2005, 2005, 2006, 2006, 2007, 2007, 
2009, 2009, 2009, 2010, 2010, 2011, 2006, 2006, 2007, 2007, 2009, 
2011, 2011, 2005, 2005, 2006, 2006, 2007, 2008, 2009, 2009, 2010, 
2010, 2010, 2018, 2018, 2020, 2020, 2021, 2021, 2021, 2007, 2008, 
2009, 2007, 2007, 2009, 2009, 2008, 2009, 2009, 2006, 2007, 2008, 
2009, 2008, 2008, 2009, 2009, 2012, 2006, 2006, 2007, 2009, 2009, 
2010, 2010, 2007, 2007, 2008, 2008, 2009, 2009, 2010, 2012, 2006, 
2006, 2006, 2007, 2008, 2009, 2009, 2007, 2007, 2008, 2009, 2009, 
2005, 2005, 2006, 2006, 2008, 2009, 2010, 2012, 2012, 2013, 2014, 
2015, 2015, 2016, 2017, 2017, 2018, 2018, 2019, 2019, 2020, 2020, 
2021, 2021, 2021, 2005, 2005, 2006, 2006, 2007, 2008, 2009, 2009, 
2009, 2010, 2010, 2011, 2006, 2006, 2006, 2007, 2007, 2007, 2008, 
2009, 2009, 2009, 2010, 2010, 2010, 2020, 2021, 2021, 2006, 2011, 
2006, 2006, 2007, 2009, 2010, 2010, 2020, 2021, 2021, 2009, 2009, 
2009, 2010, 2010, 2010, 2006, 2006, 2006, 2016, 2006, 2007, 2009, 
2010, 2010, 2005, 2006, 2006, 2007, 2007, 2009, 2006, 2006, 2010, 
2010, 2005, 2005, 2006, 2006, 2010, 2010, 2005, 2005, 2006, 2006, 
2010, 2010, 2006, 2010, 2006, 2006, 2005, 2006, 2006, 2010, 2010, 
2007, 2005, 2005, 2006, 2006, 2007, 2010, 2010, 2010, 2012, 2012, 
2014, 2014, 2014, 2016, 2016, 2006, 2006, 2010, 2006, 2006, 2010, 
2010, 2006, 2006, 2007, 2014, 2015, 2013, 2014, 2007, 2006, 2006, 
2007, 2007, 2014, 2006, 2007, 2014, 2015, 2015, 2006, 2007, 2006, 
2007, 2014, 2016, 2006, 2006, 2007, 2009, 2013, 2014, 2015, 2015, 
2016, 2016, 2016, 2018, 2018, 2006, 2006, 2007, 2014, 2016, 2018, 
2007, 2007, 2006, 2006, 2007, 2007, 2009, 2018, 2018, 2018, 2007, 
2006, 2007, 2005, 2006, 2007, 2011, 2011, 2011, 2011, 2011, 2011, 
2016, 2016, 2011, 2011, 2016, 2011, 2011, 2016, 2016, 2017, 2018, 
2018, 2019, 2011, 2011, 2016, 2018, 2019, 2019, 2011, 2011, 2016, 
2007, 2007, 2019, 2019, 2005, 2005, 2005, 2006, 2006, 2006, 2007, 
2008, 2008, 2008, 2008, 2012, 2012, 2005, 2006, 2006, 2007, 2008, 
2008, 2010, 2010, 2012, 2012, 2012, 2015, 2015, 2016, 2016, 2017, 
2017, 2018, 2018, 2019, 2019, 2005, 2007, 2007, 2008, 2008, 2010, 
2010, 2011, 2011, 2012, 2012, 2013, 2013, 2014, 2015, 2016, 2016, 
2017, 2017, 2018, 2018, 2019, 2019, 2021, 2021, 2021, 2005, 2005, 
2007, 2008, 2010, 2010, 2012, 2012, 2012, 2013, 2013, 2014, 2014, 
2015, 2016, 2018, 2018, 2019, 2019, 2005, 2007, 2007, 2008, 2008, 
2010, 2011, 2011, 2011, 2012, 2012, 2013, 2013, 2014, 2015, 2016, 
2016, 2017, 2017, 2018, 2018, 2019, 2019, 2021, 2017, 2018, 2019, 
2019, 2020, 2021, 2021, 2021, 2005, 2007, 2008, 2010, 2010, 2012, 
2012, 2013, 2013, 2014, 2015, 2015, 2016, 2016, 2017, 2017, 2018, 
2019, 2019, 2005, 2005, 2007, 2007, 2008, 2010, 2017, 2017, 2005, 
2007, 2008, 2010, 2010, 2010, 2015, 2018, 2018, 2019, 2019, 2005, 
2007, 2007, 2008, 2008, 2010, 2010, 2010, 2012, 2012, 2013, 2013, 
2014, 2014, 2015, 2015, 2016, 2016, 2017, 2017, 2018, 2018, 2019, 
2019, 2006, 2007, 2009, 2009, 2009, 2011, 2011, 2012, 2015, 2015, 
2006, 2010, 2013, 2013, 2006, 2007, 2007, 2007, 2007, 2007, 2007, 
2013, 2013, 2019, 2007, 2007, 2013, 2013, 2019, 2019, 2007, 2007, 
2013, 2007, 2013, 2007, 2013, 2013, 2018, 2013, 2013, 2005, 2005, 
2007, 2007, 2019, 2019, 2007, 2008, 2010, 2010, 2012, 2012, 2013), species = c("ramu", 
"ramu", "hyre", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"hyre", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "hyre", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "hyre", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "hyre", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "hyre", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "hyre", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "hyre", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"hyre", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "ramu", 
"ramu", "ramu", "ramu", "ramu", "ramu", "ramu", "hyre", "ramu"), wilderness = c("kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
"kings_canyon", "kings_canyon", "kings_canyon", "kings_canyon", 
), visual_life_stage = c("adult", "subadult", 
"adult", "adult", "adult", "subadult", "adult", "subadult", "tadpole", 
"adult", "adult", "tadpole", "adult", "subadult", "adult", "subadult", 
"tadpole", "subadult", "tadpole", "adult", "subadult", "tadpole", 
"subadult", "tadpole", "adult", "subadult", "tadpole", "adult", 
"subadult", "adult", "subadult", "tadpole", "adult", "subadult", 
"tadpole", "adult", "tadpole", "adult", "subadult", "adult", 
"tadpole", "adult", "adult", "subadult", "adult", "subadult", 
"tadpole", "adult", "subadult", "tadpole", "adult", "adult", 
"tadpole", "adult", "subadult", "adult", "subadult", "tadpole", 
"adult", "subadult", "adult", "adult", "subadult", "adult", "subadult", 
"tadpole", "adult", "subadult", "tadpole", "adult", "subadult", 
"adult", "subadult", "adult", "subadult", "adult", "subadult", 
"tadpole", "adult", "subadult", "adult", "subadult", "tadpole", 
"adult", "subadult", "subadult", "tadpole", "adult", "subadult"), bd = c(0, 0, 7.09090982207998, 
2.63134509445244, 9.36022482151348, 13.5664349074635, 7.36592415296178, 
8.92682623801668, 8.48744252116629, 0, 0, 0, 0, 4.57471097850338, 
5.46498853835418, 5.95324333428778, 0, 15.100981041748, 9.32006483928396, 
6.86875288505108, 15.1757274031426, 12.3978306605339, 0, 6.17586727010576, 
11.2983575376563, 3.08793363505288, 8.21527695893663, 6.73746765775748, 
11.3154618435662, 8.92119055624937, 11.1246861375271, 2.48836687121029, 
8.96629795271352, 13.8645039222345, 11.2132927006919, 8.25847005945237, 
11.6298290779796, 0, 0, 8.60967703443485, 10.5707270075549, 5.95324333428778, 
8.01466637046494, 14.2799251687388, 8.27817429094374, 13.507659791222, 
10.3933244458636, 7.15814038668953, 6.31096500294628, 11.6924661587463, 
7.98091299817778, 8.48654520606966, 13.0206399256495)), row.names = c(NA, -2808L), class = c("tbl_df", 
"tbl", "data.frame"))

UI

ui <- fluidPage(
  
  
  
  
  #includeCSS(here("NPS_ShinyApp/theme.css")),
  
  theme = theme,
  
  
  titlePanel(""),
  
  fluidPage(
    fluidRow(column(8,
                    h1(strong("National Park Service App - RIBBiTR ")))),
  
  
  navbarPage("", inverse = T,
             
             tabPanel("Home", icon = icon("info-circle"),
                      fluidPage(
                        fluidRow(
                          h1(strong("Disclaimer"), style = "font-size:20px;"),
                          
                          column(12, p(""))),
                        
                        fluidRow(
                          h1(strong("Intended Use"),style = "font-size:20px;"),
                          
                          column(12, p(""))),
                        
                        fluidRow(
                          h1(strong("Data Collection"),style = "font-size:20px;"),
                          column(12, p(""))))),
             
             
             tabPanel(title = "Site Map", icon = icon("globe-asia"),
                      
                      sidebarLayout(
                        
                        sidebarPanel(
                          
                                                          sliderInput(inputId = "bd_date",
                                            label = "Select an annual range",
                                            min = min(bd_data$date), max = max(bd_data$date), 
                                            value =  c((max(bd_data$date) - 5), max(bd_data$date)),
                                            sep = ""),
                                pickerInput(inputId = "wilderness_2",
                                            label = "Select a wilderness",
                                            choices = unique(bd_data$wilderness),
                                            multiple = F,
                                            selected = ""),
                                pickerInput(inputId = "bd_species",
                                            label = "Select a species",
                                            choices = unique(bd_data$species),
                                            multiple = F,
                                            selected = "ramu"),
                                pickerInput(inputId = "stage",
                                            label = "Select a life stage",
                                            choices = unique(bd_data$visual_life_stage),
                                            selected = "adult",
                                            multiple = F),
                                pickerInput(inputId = "bd_id",
                                            label = "select site",
                                            choices = unique(bd_data$id),
                                            multiple = F)),
                        
                        mainPanel(plotOutput(outputId = "bd_plots")))
                      
             )
             

Server
server <- function(input, output, session){
 bd_reac <- reactive({
      
      bd_data %>% 
        dplyr::filter(date %in% input$bd_date[1:2], wilderness == input$wilderness_2, species == input$bd_species, 
                      visual_life_stage == input$stage, id == input$bd_id)
      
    })
    
    ### I believe my error is occuring with the filtering or plotting of the data here or just above
    output$bd_plots <- renderPlot({
      
      ggplot(data = bd_reac()) +
        geom_point(aes(x = date, y = bd)) +
        xlim(c(input$bd_date[1:2]))
    })
    
    
    observeEvent(input$bd_date, {
      
      updatePickerInput(session, inputId = "wilderness_2", 
                        choices = unique(bd_data$wilderness[bd_data$date %in% input$bd_date[1:2]]), 
                        selected = "yosemite")
    })
    
    
    observeEvent(input$wilderness_2, {
      
      updatePickerInput(session, inputId = "bd_species", 
                        choices = unique(bd_data$species[bd_data$date %in% input$bd_date[1:2] 
                                                          & bd_data$wilderness == input$wilderness_2]))
      
    })
    
    observeEvent(input$bd_species, {
      
      updatePickerInput(session, inputId = "stage", 
                        choices = unique(bd_data$visual_life_stage[bd_data$date %in% input$bd_date[1:2] 
                                                     & bd_data$wilderness == input$wilderness_2 
                                                     & bd_data$species == input$bd_species]))
    })
    
    observeEvent(input$stage, {
      
      updatePickerInput(session, inputId = "bd_id",
                        choices = unique(bd_data$id[bd_data$date %in% input$bd_date[1:2] 
                                                    & bd_data$wilderness == input$wilderness_2 
                                                    & bd_data$species == input$bd_species
                                                    & bd_data$visual_life_stage == input$stage]))
    })
    
    
    
}


Global

if (!require(librarian)){
  install.packages("librarian")
  library(librarian)
}

# librarian downloads, if not already downloaded, and reads in needed packages

librarian::shelf(shiny, tidyverse, here, shinyWidgets, leafem, bslib, thematic, shinymanager, leaflet, ggrepel, sf)

             
             
             

Leave a Comment