geolines: Add lines to current plot initialized by geoplot.

Description Usage Arguments Value Side Effects See Also Examples

View source: R/geolines.R

Description

Add lines to a plot initialized by geoplot. Data is stored as lat, lon or x,y. Lists are assumed to have the components $x and $y if projection in geoplot was "none", else $lat,$lon. The program transforms the data as specified in geoplot. Similar to the Splus function lies.

Usage

1
2
geolines(lat, lon = 0, col = 1, lwd = 0, lty = 0, nx = 1,
  outside = FALSE, return.data = FALSE)

Arguments

lat

Latitude of data. ( or x coordinate)

lon

Longitude of data. ( or y coordinate) Negative values mean western longitudes. Default value is zero. If lon is zero then the data is stored as lat$lat and lat$lon. (or lat$x and lat$y)

col

Colour number used for plotting the lines, default value is 1.

lwd

Line width. Default is to use the width set when the program was called.

lty

Line type. Default is to use the width set when the program was called. See Splus manuals for numbers corresponding to different linetypes and linewidths.

nx

Parameter only used with Lambert transform when lines in lat,lon are curves in x,y. If nx > 1, nx-1 points are put between each two datapoints in lat, lon before projection is done. For example:

geolines(c(66, 66), c(-30, -10), nx = 50)

plots a line onto the 66 degree latitude from -30 to -10. The line is curved because it is made of 50 segments.

outside

Logical, should lines outside the plot region be drawn? Default FALSE.

return.data

Logical, should the data be returned? Default FALSE.

Value

No values returned.

Side Effects

The projection is stored in geopar\$projection and parameters for the transform in geopar$b0, geopar$b1 and geopar$l1.

See Also

geoplot, geopolygon, geopoints, geotext, geosymbols, geocontour.fill, geogrid, geocontour.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
geolines(island)                      # plot iceland.
       geolines(island$lat, island$lon, col = 1) # same.

       #######################################################

       geoplot(xlim=c(0, -50), ylim=c(60, 75), projection = "Lambert")
       # Set up a Lambert plot.

       geolines(c(66, 66), c(-30, -10), nx = 50, col = 155, lwd = 2)
       # Draw a line with colour 155 and width 2.

       geopolygon(island)
       geolines(island, col = 3, lwd = 3)
       geolines(eyjar, col = 40)
       geolines(faeroes, col = 40)
       geolines(greenland, col = 3, lwd = 3)
#       geolines(janmayen, col = 40)
       # Plot some more countries using geolines.

geo documentation built on May 29, 2017, 5:36 p.m.