match_mon_day: match_mon_day

View source: R/match_mon_day.R

match_mon_dayR Documentation

match_mon_day

Description

match_mon_day() is used to export multiple ocean productivity values from the download files by your longitude, latitude and date

Usage

match_mon_day(data, file.path, time.span = "monthly")

Arguments

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'.

Value

A data frame

Note

This function should only be used when you have the 'month' variable. Any other time, match_sig should be used. Please see examples.

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)

chaoxv/nppr documentation built on Jan. 29, 2024, 1:37 p.m.