$ sudo install netcdf-devel $ R --no-restore --no-save > install.packages('ncdf4') > q()
There's a good summary of using NetCDF here.