Description Usage Arguments Details Value
View source: R/load-data-with-time-variable.R
Load all .nc files as a list in a given local path and resize them while loading.
1 2 3 4 |
path |
Path where to .nc files are located. Example: /home/data. Character. |
from |
starting year (included). Either a numeric or a character. Example: 2009. |
to |
ending year(included). Either a numeric or a character. Example: 2010. |
variables |
variables to be extracted from .nc file. A character vector. Defaults to c("qnet") |
coordinates |
longitude and latitude names. Defaults to c("lon", "lat") |
spare_coordinates |
Spare names for coordinates. Variables such as longitude and latitude may be named differently in every .nc file. In order to account this possibility, you can provide a set of spare names for both coordinates. Set by default to be: c("longitude","latitude"). |
time_variable |
variable representing the frequency of the observations. Character. Defaults to "time". |
lower_left_lat_lon |
lower left corner latitude and longitude of the selected area. Set by default. |
upper_right_lat_lon |
upper right corner latitude and longitude of the selected area. Set by default. |
monthly |
whether data has a monthly or an annual frequency. Boolean. Set equal to TRUE if data has a monthly frequency. Set to FALSE if frequency is annual. FALSE by default. |
date_origin |
If the dates in the .nc files are the number of hours from a fixed origin, please specify origin date as "yyyy-mm-dd". By default origin date is assumed to be 1st January of each year (the year is read from the file name). |
Note: these function is used to load .nc files containing a time variable. They represent observations of a certain variable with a given frequency. The variable "time" defines the name of the sampling frequency variable. The function assumes that the data has a daily frequency. If the frequency is monthly, please set the monthy variable to TRUE.
Due to the size of such files, immediate cropping of the selected geographical area is performed at load time. Note that the size of the area should be specified in the arguments lower_left_lon_lat and upper_right_lon_lat. If these arguments are not specified, defaults will be used.
Dates are assumed to begin from the 1st of January. If the dates are in the format "hours" from a given date", please specify the starting date in the format "yyyy-mm-dd". Please note that no other formats are accepted. See the parameter date_origin below.
a list of dplyr dataframes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.