Learn R Programming

biogeo (version 1.0)

pointsworld: Plots point records on a world map using their latitude and longitude

Description

Plots points on a world map. Records that fall outside of country boundaries appear in red and records inside country boundaries appear in blue.

Usage

pointsworld(world, dat, x, y, ext = c(-180, 180, -90, 90))

Arguments

world
a shapefile of the world, where the column containing the country names must be "NAMES"; see data(wrld_simpl)
dat
a dataframe containing the x- and y-coordinates in decimal degrees and a unique identifier for each record called ID
x
the name of the x-coordinate column in dat
y
the name of the y-coordinate column in dat
ext
The extent, which can be specified as c(xmin, xmax, ymin, ymax) default extent c(-180, 180, -90, 90). Alternatively if ext="p" then the extent will be calculated from the coordinates of the points in the dataset.

Value

See Also

geo2envid, alternatives, alternatives2, alternativesenv, errorcheck

Examples

Run this code
## Not run: 
# dev.new(width=7,height=7)
# a<-pointsworld(world, dat, x="x", y="y", ext = c(-180, 180, -90, 90))
# a<-pointsworld(world, dat, x="x", y="y", ext = "p")
# a<-pointsworld(world, dat, x="x", y="y", ext = c(10, 40, -35, -20))
# ## End(Not run)

Run the code above in your browser using DataLab