mapDevice: Creates a plot device set up for maps

Description Usage Arguments Value See Also Examples

Description

Creates a plot device suited for rworldmap plotting functions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
mapDevice(
            device = "dev.new"
          , rows = 1
          , columns = 1
          , plotOrder="rows"
          , width = NULL
          , height = NULL
          , titleSpace = NULL
          , mai = c(0, 0, 0.2, 0)
          , mgp = c(0, 0, 0)
          , xaxs = "i"
          , yaxs = "i"
          , ...)

Arguments

device

Character string which controls the type of plot default. The default uses your standard plot device. Giving the name of a plotting device function will use that instead. e.g. "pdf", "png", etc.

rows

The number of rows. Default 1

columns

The number of columns. Default 1

plotOrder

Option of 'rows' or 'columns'. For multiple plots whether to plot in row or column order. However, note that addMapLegend can have the effect of reverting order to rows.

width

The width of a single plot. This includes the margins. If you do not specify both width and height, suitable values will be calculated

height

The height of a single plot. This includes the margins. If you do not specify both width and height, suitable values will be calculated

titleSpace

The height in inches of the gap at the plot.

mai

The margin sizes in inches. If titleSpace is given this overrides mai[3].

mgp

As per par(mgp) in the graphics package

xaxs

As per par(xaxs) in the graphics package

yaxs

As per par(yaxs) in the graphics package

...

Further arguments to the device function

Value

Used for the side effect of creating a plot device, and setting graphical parameters for the device.

See Also

mapCountryData,mapGridAscii

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
#Basic Usage
mapDevice()
mapCountryData()

#2 by 2 plot
mapDevice(rows=2,columns=2)
columns<-c("BIODIVERSITY","EPI","ENVHEALTH","Population2005")
for(i in columns){
 mapCountryData(nameColumnToPlot=i)
}
#Creating a pdf that is 5 inches wide
mapDevice(device="pdf",width=5,file=tempfile())
mapCountryData()
dev.off()


## End(Not run)

rworldmap documentation built on May 2, 2019, 4:50 p.m.