map_track: Plot location data on a map

Description Usage Arguments Value Author(s) See Also Examples

View source: R/map_track.R

Description

Function to plot tracking data on a map or a satellite image.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
map_track(
  sdata,
  xlim = NULL,
  ylim = NULL,
  margin = 10,
  bgmap = NULL,
  google.key = NULL,
  map.bg = "grey",
  map.col = "black",
  zoom = NULL,
  point.bg = "yellow",
  point.col = "black",
  point.symbol = 21,
  point.size = 1,
  line.col = "lightgrey",
  line.type = 1,
  line.size = 0.5,
  sb.distance = NULL,
  sb.lwd = 1,
  sb.line.col = "black",
  sb.text.size = 4,
  sb.text.col = "black",
  sb.space = 3,
  title = "id",
  title.size = 11,
  axes.text.size = 11,
  axes.lab.size = 11,
  multiplot = TRUE,
  nrow = 1,
  ncol = 1
)

Arguments

sdata

A data frame containing columns with the following headers: "id", "DateTime", "lat", "lon". The function creates a map for each unique "id" (e.g. transmitter number, identifier for each animal). "DateTime" is the GMT date & time of each location in class POSIXct or character with the following format "2012-06-03 01:33:46". "lat" and "lon" are the latitude and longitude of each location in decimal degrees.

xlim, ylim

Limits for x and y axes. If not specified, the values are determined as the maximum range of the input data plus an additional margin (see margin).

margin

Set the amount of spaces added around the periphery of the plot. The value is scaled to the plot. The smaller value increases the margin.

bgmap

A data frame of a background map data, containing the following headers: "long", "lat", "group". If not specified, the world map is used. Google Maps ("terrain", "satellite", "roadmap", "hybrid") can also be queried.

google.key

If Google Maps are queried, a valid API key (a string) needs to be specified here. See register_google for details.

map.bg

Background colour of the map. This argument is ignored when any Google Maps is selected.

map.col

Outline colour of the map. This argument is ignored when any Google Maps is selected.

zoom

Map zoom for Google Maps. Default (NULL) to estimate the zoom from each data set. For other options, see get_map for details.

point.bg

The colour to fill in a symbol.

point.col

The colour for the outline of a symbol.

point.symbol

An integer or a string to specify the symbol type. See shape for details.

point.size

An integer to specify the size of the symbol.

line.col

The colour of the line that connects consecutive points.

line.type

The type of the line that connects consecutive points. See linetype for details.

line.size

An integer to specify the thickness (width) of the line that connects consecutive points.

sb.distance

An integer to specify the length of the scale bar. If not specified, approximately a quarter of the plotting range will be used.

sb.lwd

An integer to specify the thickness (width) of the scale bar.

sb.line.col

The colour of the scale bar.

sb.text.size

An integer to specify the text size for the scale bar.

sb.text.col

The colour of the text for the scale bar.

sb.space

Set the amount of space between the scale bar and the text. The value is scaled to the plot. The smaller value increases the space.

title

The main title for each plot. If not specified, the "id" will be used.

title.size

An integer to specify the size of the title.

axes.text.size

An integer to specify the size of the axes characters.

axes.lab.size

An integer to specify the size of the axes labels.

multiplot

Logical. If TRUE (default), multiple plots are displayed on the same page.

nrow

An integer to specify the number of rows in the multiple plot page.

ncol

An integer to specify the number of columns in the multiple plot page.

Value

An arrangelist is returned when multiplot is TRUE. Otherwise a list is returned.

Author(s)

Takahiro Shimada

See Also

kml_track, dupfilter, ddfilter, vmax, vmaxlp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#### Load data sets
## Fastloc GPS data obtained from two green turtles
data(turtle)
data(turtle2)
turtles<-rbind(turtle, turtle2)

#### Filter temporal and/or spatial duplicates
turtle.dup <- dupfilter(turtles, step.time=5/60, step.dist=0.001)
 

#### ddfilter
V <- vmax(turtle.dup)
VLP <- vmaxlp(turtle.dup)
turtle.dd <- ddfilter(turtle.dup, vmax=V, vmaxlp=VLP)


#### Plot filtered data for each animal
## using the low-resolution world map
map_track(turtle.dd, point.size = 2, line.size = 0.5, axes.lab.size = 0, ncol=2, nrow=1)

## Not run: 
## using the high-resolution google satellite images
map_track(turtle.dd, bgmap = "satellite", google.key = "key", ncol=2)

## End(Not run)

SDLfilter documentation built on July 20, 2021, 9:07 a.m.