[R-sig-Geo] masking_data

Kunal Bali kun@|@b@||9 @end|ng |rom gm@||@com
Tue Apr 23 09:51:35 CEST 2019


Dear R users,
Could anyone please let me know how to mask the data over only Indian
region.

my code is


august_temp <-ReadNetCDF("/Users/kunalbali/Desktop/test/soma/india.nc")
str(august_temp)

shapeindia <-
readOGR(dsn="/Users/kunalbali/Desktop/india/",layer="india_state")
shapefile_df <- fortify(shapeindia)

ggplot(august_temp[time == time[1]], aes(lon, lat)) +
  geom_contour_fill(aes(z = olr)) + scale_fill_distiller(palette =
"OrRd",trans = "reverse") +
  geom_path(data = shapefile_df,
            aes(x = long, y = lat, group = group),
            color = 'black', size = .5) +
  metR:::theme_field()


---
Kunal Bali

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list