Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opening a .nc file in R [duplicate]

Tags:

r

netcdf

I am new to R Programming and am having difficulty getting a .nc file into R. I have read about 'ncdf' and 'netCDF' packages which can do this but they appear not to be recognised by R anymore. Now, I am completely lost as to what do do next. Is there a package that can do this?

The file is: shum_daily_2010-2010.nc and it is climate data.

like image 335
Seanosapien Avatar asked Feb 08 '23 20:02

Seanosapien


1 Answers

You can open nc files with the raster package:

library("raster")
r = raster("data/nc_3B42.20060101.03.7A.HDF.Z.ncml.nc")

which can be installed in the usual way

install.packages("raster")
like image 107
csgillespie Avatar answered Feb 16 '23 03:02

csgillespie