Raphaël Lavoie
2014-Mar-03 15:42 UTC
[R] Circular density estimate to a raster for mapping in GIS - help
Hi all,
I created a circular density estimate using package "circular" from
bearings
(directions) from 0 to 360° assuming a von Mises distribution.
#############
library(circular)
Bearing<-
c(186,197,158,206,206,185,186,224,183,173,175,240,201,197,
175,173,226,227,233,193,175,217,171,193,190,186,222,185,
208,194,230,184,223,183,190,229,228,234,187)
circular(Bearing, type=c("angles", "directions"),
units=c("degrees"),
template=c("geographics"))
plot(Bear <- circular(Bearing, type=c("angles"),
units=c("degrees"),
rotation = c("clock"), zero=1.570796), ticks=T, stack=T, bins=360,
xlim=c(-2,1), ylim=c(-2,1))
mle.vonmises(Bear, mu=NULL, kappa=NULL, bias=FALSE,
control.circular=list(units="degrees")) ## estimated (±SE)
x <- rvonmises(n=39, mu=199.2, kappa=7.351,
control.circular=list(units="degrees"))
res25 <- density(x, bw=25, control.circular=list(units="degrees"),
kernel="vonmises")
circularp(res25$x)
lines(res25, points.plot=F, xlim=c(-2,1))
#############
The output is probabilities that an object is going in a given direction
(destination) from a specific location (origin). More specifically, there is
a probability estimate for each direction (each 360 degree wedge).
I would then like to create raster (0.5 x 0.5°) from that circular
distribution with the center being the point of origin and the different
directions displaying the underlying probabilities that an object is going
in a direction (destination). Imagine a pie chart with 360 pie slices having
each a specific probability. I tried to use the "raster" package, but
can't
figure out how to do it. Can anyone help?
Thanks!
Raph
[[alternative HTML version deleted]]