load_all_as_list: Load all .nc files in a given local path

Description Usage Arguments Value

View source: R/loading-data-functions.R

Description

Load all .nc files in a given local path

Usage

1
2
3
load_all_as_list(path, from = NULL, to = NULL, variables = c("CHL1_mean"),
  coordinates = c("lon", "lat"), spare_coordinates = c("longitude",
  "latitude"), date_format = "ymd", date_match_position = 1)

Arguments

path

Path where to .nc files are located. Example: /home/data. Character.

from

Starting date to load files. Character. Must be in the same format selected with the parameter date_format. By default "from" is NULL.

to

Ending date to load files. Character. Must be in the same format selected with the parameter date_format. By default "to" is NULL.

variables

variables to be retrieved from the .nc file. A character vector of length n. Set by default to be: c("CHL1_mean").

coordinates

Grid variables (for instance, longitude and latitude). Set by default to be: 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").

date_format

date format. By default it is set to be "ymd" (year, month, day). This is the format of the date in each filename. It can be set to other values such as "dmy" and "mdy". Check lubridate's package help for more information.

date_match_position

An integer. If the name of each file contains one or more dates, chose which one will be used as the current date for the file. Example: if a file is named "20150202file2_20150706.nc", if date_match_position is set to 1 (default), the first date, 20150202 will be used. If you'd like to use the second one, set the parameter to 2 and so on.

Value

A list of all the .nc files loaded


pegoraro/qchlorophyll documentation built on May 24, 2019, 11:46 p.m.