[R] Contour plots in R Studio

Pascal Oettli kridox at ymail.com
Tue May 13 04:28:03 CEST 2014


Hi Lydia,

Your question match more the topics of the r-sig-geo list.

Please have a look at the "raster" package, as well as the "rasterVis"
package to read and work with NetCDF format.

Regards,
Pascal

On Tue, May 13, 2014 at 6:27 AM, Lydia Keppler <lydiakeppler at gmail.com> wrote:
> Hi all,
>
> I am using Windows 7 and R Studio version 3.0.2 (2013-09-25).
> I am relatively new to R and am trying to make a contour plot from a 3D
> data grid.
>
> I my data file has the following specifics:
>
> [1] "file Data.nc has 3 dimensions:"
> [1] "time   Size: 96"
> [1] "lat   Size: 21"
> [1] "lon   Size: 61"
> [1] "------------------------"
> [1] "file Data.nc has 2 variables:"
> [1] "double U[time,lat,lon]  Longname:U Missval:1e+30"
> [1] "double V[time,lat,lon]  Longname:V Missval:1e+30"
>
> lat and lon includes latitude and longitude values from a certain region in
> a 1°grid
> time includes different months over 8 years
>
> I would like to draw
> 1) a contourplot of the mean U (mean U of all times), at the different
> locations (x=lon, y=lat)
> 2) a contourplot of U at the different locations (x=lon, y=lat) at
> different times.
>
> I have only made contourplots with 2D data (i.e. contour (lat,lon, z) and
> am struggling a bit to find help.
>
> Any suggestions are very much appreciated.
> Cheers,
>
> Lydia
>
> --
>><((((º>
>
>         [[alternative HTML version deleted]]
>
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Pascal Oettli
Project Scientist
JAMSTEC
Yokohama, Japan



More information about the R-help mailing list