I am trying to extract monthly sea surface temperature, monthly chlorophyll concentration, depth, salintity via R. My tibble consist of 10000 presence-only data with columns of year, month, data, latitude and longitude.
How can I extract the value response to each data point and combine them into a table?
I have tried using MODISSsubset, but there is an error.
for (i in 1:nrow(hb_df)) {
longitude <- hb_df$decimalLongitude[i]
latitude <- hb_df$decimalLatitude[i]
year <- hb_df$year[i]
month <- hb_df$month[i]
# Use MODISSubsets function to retrieve the SST data
sst_data <- MODISSubsets(lon = longitude, lat = latitude, product = "sst", year = year, month = month)}