plot.shiftfit: Plot results of an range-shift fit

Description Usage Arguments Examples

View source: R/plot.shiftfit.r

Description

Plotting functions for illustrating the results of a range-shift fit.

Usage

1
2
3
4
## S3 method for class 'shiftfit'
plot(x, ns = c(n.sims = 1000, n.times = 100, n.bins = 10),
  plot.ts = TRUE, stretch = 0, pt.cex = 0.8, pt.col = "antiquewhite",
  CI.cols = NULL, layout = NULL, par = NULL, ...)

Arguments

x

a fitted range shift object, i.e. output of the estimate_shift

ns

a vector of 3 simulation values, useful for smoothing the bars in the dumbbell plot. For smoothing, it might be recommended to increase the first value, n.sims - the number of draws from the fitted migation process.

plot.ts

whether or not to plot the time series as well

stretch

an extra parameter to extend the bars on the dumbbells (in real distance units).

pt.cex

point character expansion.

pt.col

points color.

CI.cols

three shading colors, from lightest to darkest. The default is a sequence of blues.

layout

the default layout places the x-y plot on the left and - if plot.ts==TRUE - the respective 1-d time series on the right.

par

graphics window parameters that, by default, look nice with the default layout.

...

additional parameters to pass to plot function (e.g. labels, title, etc.)

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
31
# load simulated tracks
data(SimulatedTracks)

# white noise fit
MWN.fit <- with(MWN.sim, estimate_shift(T=T, X=X, Y=Y))
summary(MWN.fit)
plot(MWN.fit)

if(interactive()){
# OUF fit
MOUF.fit <- with(MOUF.sim.random, 
                estimate_shift(T=T, X=X, Y=Y, 
                               model = "ouf", 
                               method = "like"))
summary(MOUF.fit)
plot(MOUF.fit)

# Three range fit:
# it is helpful to have some initital values for these parameters 
# because the automated quickfit() method is unreliable for three ranges
# in the example, we set a seed that seems to work
# set.seed(1976)

 MOU.3range.fit <- with(MOU.3range, 
                       estimate_shift(T=T, X=X, Y=Y, 
                                      model = "ou", 
                                      method = "ar", 
                                      n.clust = 3))
 summary(MOU.3range.fit)
 plot(MOU.3range.fit)
}

marcher documentation built on May 2, 2019, 9:44 a.m.