I have 2 data sets, one contains my data and the other contains the sunrise/sunset data from the NAVY Observatory.
head(tagdata)
X ID ex2 meanlat meanlong meanEast meanNorth meandepth rec numhits species depthcat Date Time
1 1 34931 2015-07-31 13:06:26 18.34127 -64.98051 290711.7 2029082 NA 10 42 Lutjanus synagris NA 2015-07-31 13:06:26
2 2 34931 2015-07-31 14:06:26 18.34141 -64.98054 290708.6 2029097 NA 10 55 Lutjanus synagris NA 2015-07-31 14:06:26
3 3 34931 2015-07-31 15:06:26 18.34115 -64.98023 290741.3 2029068 NA 9 53 Lutjanus synagris NA 2015-07-31 15:06:26
4 4 34931 2015-07-31 16:06:26 18.34158 -64.98012 290753.0 2029115 NA 9 38 Lutjanus synagris NA 2015-07-31 16:06:26
5 5 34931 2015-07-31 17:06:26 18.34162 -64.97979 290788.0 2029119 NA 8 32 Lutjanus synagris NA 2015-07-31 17:06:26
6 6 34931 2015-07-31 18:06:26 18.34102 -64.97949 290818.5 2029053 NA 6 27 Lutjanus synagris NA 2015-07-31 18:06:26
head(AstroSun)
Date Srise Sset Sunrise_date Sunset_date Astro_Begin Astro_End ABegin_date AEnd_date
1 2015-01-01 652 1755 2015-01-01 06:52:00 2015-01-01 17:55:00 534 1913 2015-01-01 05:34:00 2015-01-01 19:13:00
2 2015-01-02 652 1756 2015-01-02 06:52:00 2015-01-02 17:56:00 534 1913 2015-01-02 05:34:00 2015-01-02 19:13:00
3 2015-01-03 652 1756 2015-01-03 06:52:00 2015-01-03 17:56:00 535 1914 2015-01-03 05:35:00 2015-01-03 19:14:00
4 2015-01-04 653 1757 2015-01-04 06:53:00 2015-01-04 17:57:00 535 1914 2015-01-04 05:35:00 2015-01-04 19:14:00
5 2015-01-05 653 1757 2015-01-05 06:53:00 2015-01-05 17:57:00 535 1915 2015-01-05 05:35:00 2015-01-05 19:15:00
6 2015-01-06 653 1758 2015-01-06 06:53:00 2015-01-06 17:58:00 536 1915 2015-01-06 05:36:00 2015-01-06 19:15:00
I want to merge both data sets and create a new column that adds day or night for each observation, based on the sunrise and sunset time frames from the Navy data. How do I go about it? Also, how can I add dusk and dawn to each observation, where by each observation starts an hour before sunrise or sunset and ending an hour after sunrise or sunset time?