@@ -54,7 +54,7 @@ map.poly <- function(database, regions = ".", exact = FALSE,
5454 the.map <- SpatialPolygons2map(database , namefield = namefield )
5555 } else if (inherits(database ," SpatialLines" )) {
5656 the.map <- SpatialLines2map(database , namefield = namefield )
57- } else if (is.list(database ) &&
57+ } else if (is.list(database ) &&
5858 all(c(" x" , " y" , " names" ) %in% names(database ))) {
5959 the.map <- database
6060 } else {
@@ -98,7 +98,7 @@ map.poly <- function(database, regions = ".", exact = FALSE,
9898 stop(" nothing to draw: all regions out of bounds" )
9999 # turn the polyline numbers into x and y coordinates
100100 if (as.polygon ) {
101- coord <- mapgetl(database , line $ number , xlim , ylim , fill )
101+ coord <- mapgetl(database , line $ number , xlim , ylim , fill )
102102 # assemble lines into polygons
103103 gonsize <- line $ size
104104 keep <- rep(TRUE , length(gonsize ))
@@ -128,14 +128,14 @@ map <-
128128function (database = " world" , regions = " ." , exact = FALSE ,
129129 boundary = TRUE , interior = TRUE , projection = " " ,
130130 parameters = NULL , orientation = NULL , fill = FALSE ,
131- col = 1 , plot = TRUE , add = FALSE , namesonly = FALSE ,
131+ col = 1 , plot = TRUE , add = FALSE , namesonly = FALSE ,
132132 xlim = NULL , ylim = NULL , wrap = FALSE ,
133133 resolution = if (plot ) 1 else 0 , type = " l" , bg = par(" bg" ),
134- mar = c(4.1 , 4.1 , par(" mar" )[3 ], 0.1 ), myborder = 0.01 ,
134+ mar = c(4.1 , 4.1 , par(" mar" )[3 ], 0.1 ), myborder = 0.01 ,
135135 namefield = " name" , lforce = " n" , ... )
136136{
137137 # parameter checks
138- if (resolution > 0 && ! plot )
138+ if (resolution > 0 && ! plot )
139139 stop(" must have plot=TRUE if resolution is given" )
140140 if (! fill && ! boundary && ! interior )
141141 stop(" one of boundary and interior must be TRUE" )
@@ -145,11 +145,11 @@ function(database = "world", regions = ".", exact = FALSE,
145145 stop(" Please install the package 'mapproj' for projections." )
146146 }
147147 coordtype <- maptype(database )
148- if (coordtype == " unknown" )
148+ if (coordtype == " unknown" )
149149 stop(" missing database or unknown coordinate type" )
150- if (doproj && coordtype != " spherical" )
150+ if (doproj && coordtype != " spherical" )
151151 stop(paste(database , " database is not spherical; projections not allowed" ))
152- if (length(wrap )> = 2 && ! doproj && wrap [2 ] - wrap [1 ] != 360 )
152+ if (length(wrap )> = 2 && ! doproj && wrap [2 ] - wrap [1 ] != 360 )
153153 stop(" The specified longitudes for wrapping are inconsistent, they should be 360 apart." )
154154 # turn the region names into x and y coordinates
155155 if (is.character(database )) as.polygon = fill
@@ -158,7 +158,7 @@ function(database = "world", regions = ".", exact = FALSE,
158158 # to get all necessary polylines/polygons is to set xlim=NULL *temporarily*
159159 # (alternatively, the C code must shift longitudes by +/- 360 to fit in boundaries)
160160 xlim_tmp <- if (length(wrap )> = 2 ) NULL else xlim
161- coord <- map.poly(database , regions , exact , xlim_tmp , ylim ,
161+ coord <- map.poly(database , regions , exact , xlim_tmp , ylim ,
162162 boundary , interior , fill , as.polygon , namefield = namefield )
163163 if (is.na(coord $ x [1 ])) stop(" first coordinate is NA. Bad map data?" )
164164 if (length(wrap )> = 2 ) {
@@ -215,7 +215,7 @@ function(database = "world", regions = ".", exact = FALSE,
215215 if (is.null(ylim ) || (doproj && ! (lforce %in% c(" s" ," l" )))) yrange <- range(coord $ y , na.rm = TRUE )
216216 else yrange <- ylim
217217 if (coordtype != " spherical" || doproj ) {
218- aspect <- c(1 , 1 )
218+ aspect <- c(1 , 1 )
219219 } else
220220 aspect <- c(cos((mean(yrange ) * pi )/ 180 ), 1 )
221221 d <- c(diff(xrange ), diff(yrange )) * (1 + 2 * myborder ) * aspect
0 commit comments