This workbook sound-checks the R package SDLfilter, which was developed under / for Windows in a Ubuntu environment.
The package and the code shown here were written by Takahiro Shimada.
turtle: Fastloc GPS data obtained from a green turtlebasemap: A Map for the example sitedata(turtle)
data(basemap)
turtle.dupfilter <- dupfilter(turtle, step.time=5/60, step.dist = 0.001)
##
## dupfilter.exact removed 0 of 429 locations
## dupfilter.qi removed 2 of 429 locations
## dupfilter.time removed 2 of 427 locations
## dupfilter.space removed 0 of 425 locations
##
## Input data: 429 locations
## Filtered data: 425 locations
## dupfilter removed 4 locations (0.93% of original data)
vmax <- est.vmax(turtle.dupfilter)
##
## The maximum linear speed (Vmax) was estimated using 237 locations
## Vmax: 3.4 km/h
maxvlp <- est.maxvlp(turtle.dupfilter)
##
## The maximum one-way linear speed of a loop trip (Max.Vlp) was estimated using 11 Vlp from 6 loop trips
## Max.Vlp: 0.4 km/h
turtle.ddfilter <- ddfilter(turtle.dupfilter, vmax=vmax, maxvlp = maxvlp)
##
## ddfilter.speed removed 6 of 425 locations
## ddfilter.loop removed 26 of 419 locations
##
## Input data: 425 locations
## Filtered data: 393 locations
## ddfilter removed 32 locations (7.53% of original data)
par(mfrow=c(1,2))
wgs84 <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")
par(mar=c(4,5,2,1))
LatLong <- data.frame(Y=turtle.dupfilter$lat, X=turtle.dupfilter$lon)
coordinates(LatLong) <- ~X+Y
proj4string(LatLong) <- wgs84
plot(LatLong, pch=21, bg="yellow", xlim=c(147.8, 156.2), ylim=c(-32, -20))
axis(1, at=seq(from = 148, to = 156, by=4))
axis(2, at=seq(from = -32, to = -20, by=4), las=2)
box()
mtext("Longitude", side=1, line=2.5)
mtext("Latitude", side=2, line=3.5)
title("Unfiltered")
par(mar=c(4,4,2,2))
LatLong <- data.frame(Y=turtle.ddfilter$lat, X=turtle.ddfilter$lon)
coordinates(LatLong) <- ~X+Y
proj4string(LatLong) <- wgs84
plot(LatLong, pch=21, bg="yellow", xlim=c(147.8, 156.2), ylim=c(-32, -20))
axis(1, at=seq(from = 148, to = 156, by=4))
axis(2, at=seq(from = -32, to = -20, by=4), las=2)
box()
mtext("Longitude", side=1, line=2.5)
title("Filtered")
par(mar=c(4,5,2,1))
plot(basemap, col="grey", xlim=c(152.8, 153.1), ylim=c(-25.75, -25.24))
axis(1, at=seq(from = 152, to = 154, by=0.2))
axis(2, at=seq(from = -26, to = -25, by=0.2), las=2)
mtext("Longitude", side=1, line=2.5)
mtext("Latitude", side=2, line=3.5)
box()
title("Unfiltered")
LatLong <- data.frame(Y=turtle.dupfilter$lat, X=turtle.dupfilter$lon)
coordinates(LatLong) <- ~X+Y
proj4string(LatLong) <- wgs84
plot(LatLong, pch=21, bg="yellow", add=TRUE)
par(mar=c(4,4,2,2))
plot(basemap, col="grey", xlim=c(152.8, 153.1), ylim=c(-25.75, -25.24))
axis(1, at=seq(from = 152, to = 154, by=0.2))
axis(2, at=seq(from = -26, to = -25, by=0.2), las=2)
mtext("Longitude", side=1, line=2.5)
box()
title("Filtered")
LatLong <- data.frame(Y=turtle.ddfilter$lat, X=turtle.ddfilter$lon)
coordinates(LatLong) <- ~X+Y
proj4string(LatLong) <- wgs84
plot(LatLong, pch=21, bg="yellow", add=TRUE)