plotAllTagsCoord: Plot all tag detections by latitude or longitude

Description Usage Arguments Author(s) Examples

View source: R/plotAllTagsCoord.R

Description

Plot latitude/longitude vs time (UTC rounded to the hour) for each tag using .motus detection data. Coordinate is by default taken from a receivers GPS latitude recordings.

Usage

1
2
plotAllTagsCoord(data, coordinate = "recvDeployLat", ts = "ts",
  tagsPerPanel = 5)

Arguments

data

a selected table from .motus data, eg. "alltags", or a data.frame of detection data including at a minimum variables for recvDeployName, fullID, mfgID, date/time, latitude or longitude

coordinate

column name from which to obtain location values, by default it is set to recvDeployLat

ts

column for a date/time object as numeric or POSIXct, defaults to ts

tagsPerPanel

number of tags in each panel of the plot, by default this is 5

Author(s)

Zoe Crysler zcrysler@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
You can use either a selected tbl from .motus eg. "alltags", or a data.frame, instructions to convert a .motus file to all formats are below.
sql.motus <- tagme(176, new = TRUE, update = TRUE) # download and access data from project 176 in sql format
tbl.alltags <- tbl(sql.motus, "alltags") # convert sql file "sql.motus" to a tbl called "tbl.alltags"
df.alltags <- tbl.alltags %>% collect %>% as.data.frame() ## convert the tbl "tbl.alltags" to a data.frame called "df.alltags"

# Plot tbl file tbl.alltags with default GPS latitude data and 5 tags per panel
plotAllTagsCoord(tbl.alltags)

# Plot an sql file tbl.alltags with 10 tags per panel
plotAllTagsCoord(tbl.alltags, tagsPerPanel = 10)

# Plot dataframe df.alltags using receiver deployment latitudes with default 5 tags per panel
plotAllTagsCoord(df.alltags, coordinate = "recvDeployLat")

# Plot dataframe df.alltags using LONGITUDES and 10 tags per panel
plotAllTagsCoord(df.alltags, coordinate = "gpsLon", tagsPerPanel = 10)
# Plot dataframe df.alltags using lat for select motus tagIDs
plotAllTagsCoord(filter(df.alltags, motusTagID %in% c(19129, 16011, 17357)), tagsPerPanel = 1)

jbrzusto/motus documentation built on May 18, 2019, 7:03 p.m.