Couple of months ago, Charles Langton Vanya of Malawi contacted me on how to make animated rainfall map in R. I was very busy that I was not able to respond. Anyway, to Mr. Vanya, here is the code you can play on to produce a similar map as below.
Showing posts with label raster. Show all posts
Showing posts with label raster. Show all posts
Sunday, June 1, 2014
Saturday, May 31, 2014
Mindoro Digital Elevation Map Updated
Almost 2 years ago, I made a post on creating digital elevation map using R. For that post, I used the basic R plotting function to create the map. Recently, I started learning to use ggplot2 package for visualizing data. Today, I created the same map that I did two years ago, using raster and gpplot2, its for you guys to tell the difference.
Happy Coding! Use R!
Before
After
Happy Coding! Use R!
Before
After
Labels:
DEM,
ggplot2,
Mapping with R,
Mindoro,
Philippines,
R,
raster
Tuesday, August 7, 2012
Provincial Monthly Rainfall of the Philippines from WORLDCLIM
Preparing for a future conference on climate change, I downloaded and extracted average monthly rainfall in the Philippines from worldclim.org. Using maptools, raster, and animation package in R, I produced an animation of average monthly rainfall of the country.
Monday, August 6, 2012
Provincial Map using GADM
Sunday, June 17, 2012
3D Maps in R
Talking about elevation, one can also plot a wire frame 3D view of an area using the persp function. Using the same data source from my previous post, 3D view of Marinduque, Philippines was produced using the following code below:
#############################################################################################
library(maptools)
library(raster)
alt <- getData('alt', country='PHL')
adm <- getData('GADM', country='PHL', leve=1)
mar<-(adm[adm$NAME_1=="Marinduque",])
maralt<-crop(alt,mar)
persp(maralt, exp=0.2,phi=35, xlab="Longitude", ylab="Latitude", zlab="Elevation")
#############################################################################################
persp(maralt, exp=0.2,phi=35, xlab="Longitude", ylab="Latitude", zlab="Elevation", shade=0.45, col="green4")
#############################################################################################
#############################################################################################
library(maptools)
library(raster)
alt <- getData('alt', country='PHL')
adm <- getData('GADM', country='PHL', leve=1)
mar<-(adm[adm$NAME_1=="Marinduque",])
maralt<-crop(alt,mar)
persp(maralt, exp=0.2,phi=35, xlab="Longitude", ylab="Latitude", zlab="Elevation")
#############################################################################################
persp(maralt, exp=0.2,phi=35, xlab="Longitude", ylab="Latitude", zlab="Elevation", shade=0.45, col="green4")
#############################################################################################
Friday, June 15, 2012
Mindoro Digital Elevation Map
Saw a map produced by my previous student using a commercial GIS software.Using R raster package and data from diva-gis.org. I produced a similar map.
Subscribe to:
Posts (Atom)