View source: R/define_dates2load.R
define_dates2load | R Documentation |
This function creates a dataframe that can be used to load FVCOM files into R or MATLAB.
define_dates2load( start_date, end_date, custom_dates = NULL, corrupt_dates = NULL )
start_date |
A date object specifying the earliest date for which you have a FVCOM file. |
end_date |
A date object specifying the latest date for which you have a FVCOM file. Specifying |
custom_dates |
A vector of dates, for which to create the dataframe. This is an alternative to specifying |
corrupt_dates |
A vector of dates for which FVCOM files are corrupt and should not be included in the dataframe. |
A dataframe with three columns: date (a Date object), year (2 digits, a numeric object) and date_name (6 digits, a numeric object).
Edward Lavender
# 1) Define a dataframe for a regular sequence of dates between a start and end date: define_dates2load(start_date = as.Date("2016-03-01"), end_date = as.Date("2016-03-05"), corrupt_dates = NULL) # 2) Define a dataframe as above, but removing some corrupt dates: define_dates2load(start_date = as.Date("2016-03-01"), end_date = as.Date("2016-03-05"), corrupt_dates = as.Date(c("2016-03-02", "2016-03-03")) ) # 3) Define a dataframe for a custom series of dates: define_dates2load(custom_dates = as.Date(c("2016-03-02", "2016-03-03", "2017-01-01")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.