Learn R Programming

HelpersMG (version 4.3)

format_ncdf: Return an array with ncdf data

Description

Return a list with two element: data is an array and time is the POSIX.lt time./cr If varid is NULL, it shows the available variable of the file.

Usage

format_ncdf(
  ncdf,
  label.latitude = "latitude",
  label.longitude = "longitude",
  label.time = "time",
  varid = NULL
)

Arguments

ncdf

An object read from package ncdf4 or a file name of ncdf file

label.latitude

Label of latitude

label.longitude

Label of longitude

label.time

Label of time

varid

Name of variable to extract

Value

A list with two element: data is an array and time is the POSIX.lt time

Details

format_ncdf is used extract information from ncdf file

See Also

Other ncdf: ind_long_lat()

Examples

Run this code
# NOT RUN {
url <- "ftp://ftp.cdc.noaa.gov/Datasets/noaa.oisst.v2.highres/"
url <- paste0(url, "sst.day.mean.2012.v2.nc")
dest <- paste(Sys.getenv("HOME"), "/sst.day.mean.2012.v2.nc", sep="")
download.file(url, dest)
format_ncdf(dest)
# }

Run the code above in your browser using DataLab