Skip to content
(fork of CRAN ncdf4 version 1.16)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst
man
src
tests
tools
.Rbuildignore
.gitignore
.travis.yml
ChangeLog
DESCRIPTION
MD5
NAMESPACE
NEWS.md
README.Rmd
README.md
appveyor.yml
cleanup
configure
ncdf4.Rproj

README.md

Travis build status

ncdf4

The goal of ncdf4 is to provide an "Interface to Unidata netCDF (Version 4 or Earlier) Format Data Files".

This fork of the CRAN package ncdf4 is intended to update the Windows build process, and specifically to add support for Thredds.

Alternatives:

Todo

  • check Makevars.win (assume can remove "DHAVE_LIBUDUNITS2" but what about "-DHAVE_DECL_NC_RENAME_GRP=1"?)
  • add tests, especially for Thredds (make sure 32-bit Windows limitation is understood)
  • roxygenize?

Installation

You can install the released version of ncdf4 from CRAN with:

install.packages("ncdf4")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("mdsumner/ncdf4")

Example

Read from Thredds (will only work in Windows 64-bit, not 32-bit).

u <- "http://coastwatch.pfeg.noaa.gov/erddap/griddap/erdQSwind3day"
nc <- ncdf4::nc_open(u)
class(nc)
#> [1] "ncdf4"
## note that "ncdf" argument is required to trigger use of ncdf4
r <- raster::raster(u, ncdf = TRUE, varname = "x_wind")
print(r)
#> class       : RasterLayer 
#> band        : 1  (of  3774  bands)
#> dimensions  : 1201, 2881, 3460081  (nrow, ncol, ncell)
#> resolution  : 0.125, 0.125  (x, y)
#> extent      : -0.0625, 360.0625, -75.0625, 75.0625  (xmin, xmax, ymin, ymax)
#> coord. ref. : +proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0 
#> data source : http://coastwatch.pfeg.noaa.gov/erddap/griddap/erdQSwind3day 
#> names       : Zonal.Wind 
#> z-value     : 932644800 
#> zvar        : x_wind 
#> level       : 1
You can’t perform that action at this time.