plotMultiMigration: Plot Multiple Migration Fit

Description Usage Arguments Examples

View source: R/plotMultiMigration.R

Description

This function plots a multiple migration fit using the summary output of fitMultiMigration.

Usage

1

Arguments

data

A processed daily averaged data frame, i.e. output of processMovedata

M.summary

A data frame with the multi-migration summary (output of fitMultiMigration)

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
26
27
28
29
30
## Not run: 
### Enter Login and Password information for Movebank
# login <- movebankLogin(username="xxxx", password="xxxx")

# Download data
ds <- getMovebankData(study="ABoVE: NPS Dall Sheep Lake Clark", login=login) 

# Process data for use in above package
ds.mt <- processMovedata(ds,  idcolumn = "individual_id", projTo = '+init=epsg:3338', 
                        keepCols = c('sex'), dailymean = TRUE)

# Summarize and find individual
summary(ds.mt)
plot(ds.mt)

#240653478 or 240653490
di <- subset(ds.mt, id == 240653490)

# Plot movement tracks to identify migrations and use
# with locator below
par(mfrow=c(2,1), mar = c(0,0,0,0), oma = c(5,5,2,2))
with(di, plot(day, x, type='o'))
with(di, plot(day, y, type='o'))

# Use locator to bracket each individual (i.e., directional) migration
span1 <- locator(4)$x
span2 <- locator(4)$x

di.migrations <- fitMultiMigration(di, span1, span2, plot = TRUE)
di.migrations

ABoVE-AotM/above documentation built on May 28, 2020, 6:08 a.m.