####### These packages are not installed on the CRAN ####### website because they are either ####### too large or they are personal routines ####### not ready for official R-publication. #######Please try to upload: WINDOWS: http://www.unc.edu/~leesj/FETCH/GRAB/RPACKAGES/WORLDMAP2_1.0.zip http://www.unc.edu/~leesj/FETCH/GRAB/RPACKAGES/ETOPO_1.0.zip UNIX: http://www.unc.edu/~leesj/FETCH/GRAB/RPACKAGES/WORLDMAP2_1.0.tar.gz http://www.unc.edu/~leesj/FETCH/GRAB/RPACKAGES/ETOPO_1.0.tar.gz My other packages (with updates and being installed all the time) are in http://www.unc.edu/~leesj/FETCH/GRAB/RPACKAGES/ ############################ installation ###################### ##### To install these: #####UNIX: ##### become super user, then R CMD INSTALL WORLDMAP2_1.0.tar.gz ##### ##### in Windows: ##### Go to: Packages scroll to "Install packages from local (zip) files" and then choose the important zip file. ##### ##### To use the content of these packages: ##### In R, ##### you say: > library(WORLDMAP2) > data(world2) ################################################################ ####### # # # # # ####### # ####### # # # # # ## ## # # # # # # # # # # ### # # # # # ####### # ####### # # # ####### # ####### # # # # # # # # # # # # # # # # # # # # ####### # # # # # # # ###### ####### ################################################################ ####### SELECT AND PASTE FROM HERE INTO R ##################################### ####################################### ####################################### ##################################### ####################################### ####################################### #####Mon Oct 20 08:53:03 2008 library(GEOmap) library(WORLDMAP2) library(ETOPO) library(RJML) data(world2) data(ETOPO2) ##################################################################### ######################### ECUADOR MAP ######### ######### create a function for adding on to more general plot. ecuador.func<-function(PLOC, PROJ, PMAT) { LLin=list() LLin$'lat'=c(-0.078,-1.467,-2.03) LLin$'lon'=fmod( c(-77.656,-78.442,-78.33), 360) LLin$tit=c("REVENTADOR", "TUNGURAHUA", "SANGAY" ) vees = GLOB.XY( LLin$lat, LLin$lon , PROJ) ########### ### ### JML = vees ### this assumes that geomapdata has been loaded data(samer.bdy) plotGEOmapXY(samer.bdy, PROJ=PROJ, LIM=c(PLOC$LON[1], PLOC$LAT[1],PLOC$LON[2], PLOC$LAT[2] ) , add=TRUE, PMAT=PMAT$PMAT) if(!is.null(PMAT)) { JML = trans3d(vees$x, vees$y, rep(0, length(vees$y)), PMAT$PMAT) } else { JML = vees } points(JML$x, JML$y, pch=2, cex=2) pos =rep(3, length=length(LLin$tit)) text(JML$x, JML$y, labels=LLin$tit, pos=pos, font=2) } ####### LL = c(-5, 2, 278, 285 ) MORE = 'ecuador.func' HEADER = NA HTMfile = "Ecuador_Loc.html" Title1 = "EcuadorMap" imgfile = "Ecuador" #### read in localities, or just create a list: ######## ecuadorlocales =scan(file="/home/lees/Site/Ecuador/ecuador.locales", ######### list(lon=0, lat=0, name="", txt="", img="", URL="" )) ecuadorlocales=list() ecuadorlocales$'lon'=c(-78.33,-78.442,-77.656) ecuadorlocales$'lat'=c(-2.03,-1.467,-0.078) ecuadorlocales$'name'=c("Sangay", "Tungurahua", "Reventador") ecuadorlocales$'txt'=c("Sangay Volcano, Ecuador", "Tungurahua Volcano, Ecuador", "Reventador Volcano, Ecuador") ecuadorlocales$'img'=c("sangay1.jpg", "Tung_photo_small.JPG", "reventador_7227_esmall.jpg") ecuadorlocales$'URL'=c("http://dx.doi.org/10.1016/j.jvolgeores.2007.08.012", "http://www.unc.edu/~leesj/Volcano/Tungurahua_Volcano.htm", "http://www.unc.edu/~leesj/Revent_4_Web.htm") mapbar = "ecuadorbar" DP=c(10,10) #### pixel thickness of hot spot WIDTH=10 #### width of plot in inches PLOTPARMS = list(LL=LL, HEADER=HEADER, HTMfile=HTMfile,Title1=Title1,MORE=MORE, imgfile=imgfile, LOCALES=ecuadorlocales ,mapbar=mapbar, WIDTH=WIDTH, DP=DP ) ######### this function will create an html web page ####### with hot areas that pop up images described in the ecuadorlocales ####### structure AA = makePIXmap(LL, MORE, PLOTPARMS) ### ############# check map: X11() LAT1 = as.numeric(LL[1]) LAT2 = as.numeric(LL[2]) LON1 = as.numeric(LL[3]) LON2 = as.numeric(LL[4]) gLAT = c(LAT1, LAT2 ) gLON = c(LON1, LON2 ) PROJ <- setPROJ(2, LAT0 = mean(gLAT) , LON0 = mean(gLON) ) PLOC <- list( LON=gLON, LAT=gLAT) ### select from the larger map a more limited data set to reduce computation time: SMAP = SELGEOmap(world2, ncut = 3, acut = c(10, Inf), proj = PROJ, LIM = c(PLOC$LON[1], PLOC$LAT[1], PLOC$LON[2], PLOC$LAT[2])) calcol = settopocol() plotGEOmapXY(SMAP, PROJ=PROJ, LIM=c(PLOC$LON[1], PLOC$LAT[1],PLOC$LON[2], PLOC$LAT[2] ) , add=FALSE, PMAT=NULL) ############# now check the added map stuff from the function set above: ecuador.func(PLOC, PROJ, NULL) ##################################################################### ############### check this function without using the makePIXmap function ############### PMAT = GEOTOPO(ETOPO2, PLOC , PROJ, calcol$calcol) AMAT = persp(PMAT$xo, PMAT$yo, PMAT$IZ$z, theta = 0, phi = 90, r=4000, col=PMAT$Mollist[1:(PMAT$dMOL[1]-1), 1:(PMAT$dMOL[2]-1)] , scale = FALSE, ltheta = 90, lphi=30, shade = 1, border = NA, expand=0.004, box = FALSE ) plotGEOmapXY(SMAP, PROJ=PROJ, LIM=c(PLOC$LON[1], PLOC$LAT[1],PLOC$LON[2], PLOC$LAT[2] ) , add=TRUE, PMAT=PMAT$PMAT) ############# now check the added map stuff from the function set above ecuador.func(PLOC, PROJ, PMAT)