I'm currently trying to work on some spatiotemporal analysis and, as I'm actually new to R and programming in general, i'd really appreciate some opinion on what I thought would be an appropriate way to work with this data.
I have 2 large datasets, one with sea turtle stranding information (Lat and Lon from stranding, time, general biological information) and one with environmental information (sea surface temperature, current velocity and direction, wind velocity). My stranding data is from a daily monitoring program, so I have actual zeros on the dataset, and my environmental data is at daily scale, but is not constant like the strandings, so I have some NA on it. I have to make a spatiotemporal analysis with these two datasets and was thinking of making a new column, for every stranding, with the resultant environmental value a mean made with that environmental factor values that were at a 15 km radius from the stranding, up to 7 days from the stranding. So for stranding 1 sea surface temperature it would be the mean of all sea surface temperatures that i had within 15 km of stranding 1 location in the last 7 days of stranding 1 stranding. I would really like to know if creating a function that calculates this value, based on each stranding lat, lon and time, is possible, or if i'm being too oblivious. As english is not my first language, i think this can be somewhat difficult to understand if i have not expressed myself well enough, so i'll be aware if you guys think i can communicate better.
Really appreciate your time reading this and if you have the energy to help, thank you!
Edit: Thank you for your early responses! As suggested, I will provide some of the data I'm currently working with. As i dont have any code written, i can't share it, i've only made some data wrangling by today to adjust the tables and the data, but i still don't know how to work with spatial an temporal data in R.
I have made a google drive to share the tables i've been using. https://drive.google.com/drive/folders/1LlXkvkbMoaBqdA87s8FLhV7HjnidmAz2?usp=sharing, the environmental datasets are from the brazilian government and are free to use. Thank you!