R Under development (unstable) (2023-09-11 r85126 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > #+ setup > > library('mapmisc') Loading required package: terra terra 1.7.46 map images will be cached in D:\temp\Rtmp82diYY/mapmiscCache > > #if(!exists('mapmiscCachePath')) > # mapmiscCachePath = system.file('extdata', package='mapmisc') > > #if(!exists('mapmiscCacheReadOnly')) > # mapmiscCacheReadOnly = TRUE > > #mapmiscCachePath > > #options( > # mapmiscCachePath = mapmiscCachePath, > # mapmiscCacheReadOnly = mapmiscCacheReadOnly, > # mapmiscVerbose=TRUE) > > #getOption("mapmiscCachePath") > #getOption("mapmiscCacheReadOnly") > #' > > #+ themaps, fig.cap='some maps', fig.subcap = c('projectable region', 'projected, with bg','projected, with world countries','projectable madagascar','madagascar') > > > data("worldMap") > worldMap = unwrap(worldMap) > > world = project(worldMap, crsLL) > country='Japan' > x=world[grep(country, world$NAME)] > > myCrsO = moll(x) > if(!interactive()) pdf("worldMap.pdf") > > plot(world, ylim = 90.5*c(-1,1)) > plot(attributes(myCrsO)$crop, + border='red', col='#0000FF10', add=TRUE) > > > > myMap = openmap(myCrsO, zoom=1, fact=0.7) There were 20 warnings (use warnings() to see them) > map.new(myMap) > plot(myMap, add=TRUE) > plot(attributes(myCrsO)$ellipse, add=TRUE, border='black') > gridlinesWrap(myCrsO, lty=2, col='orange') > > xTcrop = wrapPoly(x=world, crs=myCrsO) > > DcountryT = grep(country, xTcrop$NAME) > > map.new(xTcrop, buffer=1000*1000) > plot(attributes(myCrsO)$ellipse, add=TRUE, col='lightBlue', border='blue') > plot(xTcrop,add=TRUE, col='grey') > plot(xTcrop[DcountryT,], col='red', lty=0, add=TRUE) > > gridlinesWrap(myCrsO, lty=2, col='orange') > > > country='Madagascar' > Dcountry = grep(country, world$NAME) > x=world[Dcountry,] > > myCrsMoll = moll(x) > > plot(world) > plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE) > > > xTcrop = wrapPoly(x=world, crs=myCrsMoll) > plot(attributes(myCrsMoll)$ellipse, col='lightBlue') > plot(xTcrop, add=TRUE, col='white') > > DcountryT = grep(country, xTcrop$NAME) > > map.new(xTcrop) > plot(attributes(myCrsMoll)$ellipse, add=TRUE, col='lightBlue', border='blue') > plot(xTcrop,add=TRUE, col='grey') > plot(xTcrop[DcountryT,], col='green', add=TRUE) > > gridlinesWrap(crs=myCrsMoll, lty=2, col='red') > > > > country='Iceland' > Dcountry = grep(country, world$NAME) > x=world[Dcountry,] > > myCrsMoll = moll(x, angle=10) The legacy packages maptools, rgdal, and rgeos, underpinning the sp package, which was just loaded, will retire in October 2023. Please refer to R-spatial evolution reports for details, especially https://r-spatial.org/r/2023/05/15/evolution4.html. It may be desirable to make the sf package available; package maintainers should consider adding sf to Suggests:. The sp package is now running under evolution status 2 (status 2 uses the sf package in place of rgdal) > xTcrop = wrapPoly(x=world, crs=myCrsMoll) > > plot(attributes(myCrsMoll)$ellipse, col='lightBlue') > plot(xTcrop, add=TRUE, col='white') > > plot(world) > plot(attributes(myCrsMoll)$crop, border='red', col='#0000FF10', add=TRUE) > > DcountryT = grep(country, xTcrop$NAME) > > map.new(myCrsMoll, col='lightBlue') > plot(xTcrop,add=TRUE, col='grey') > gridlinesWrap(crs=xTcrop, lty=2, col='red') > plot(xTcrop[DcountryT,], col='green', add=TRUE) > > if(!interactive()) dev.off() null device 1 > > #' > > > > proc.time() user system elapsed 14.18 0.56 14.90