View source: R/match_mon_day.R
match_mon_day | R Documentation |
match_mon_day() is used to export multiple ocean productivity values from the download files by your longitude, latitude and date
match_mon_day(data, file.path, time.span = "monthly")
data |
Your npp data, it can be a data frame or a tribble. |
file.path |
The folder path where the ocean productivity data saved. |
time.span |
The time span of your data. There two time spans: 'monthly' represent monthly data. 'dayly' represent 8 days data. The default is 'monthly'. |
A data frame
This function should only be used when you have the 'month' variable. Any other time, match_sig should be used. Please see examples.
## Not run:
library(nppr)
librray(tidyverse)
library(lubridate)
# Your data must contain both 'date' and 'month' variables
mydata %>% mutate(month = as.yearmon(format(date, '%Y-%m'))) %>% # create 'month' variable
group_by(month) %>% nest() %>%
mutate(var = map(data, ~match_mon_day(data, file.path = 'C:\\Users\\xucha\\Desktop\\DATA'))) %>%
unnest(var) %>% select(date, var))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.