trip.split.exact(trip)
trip.split.exact()所属R语言包:trip
Split trip events into exact time-based boundaries.
分割跳闸事件的确切时间界限。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Split trip events within a single object into exact time boundaries, adding interpolated coordinats as required.
跳闸事件拆分成精确的时间界限在一个单一的对象,加入插值坐标系下的要求。
用法----------Usage----------
trip.split.exact(x, dates)
参数----------Arguments----------
参数:x
A trip object.
走一趟的对象。
参数:dates
A vector of date-time boundaries. These must encompass all the time range of the entire trip object.
一个向量的日期,时间界限。这些都必须涵盖所有的时间范围内整个行程的对象。
Details
详细信息----------Details----------
Motion between boundaries is assumed linear and extra coordinates are added at the cut points.
运动之间的界限假定线性和额外添加的切点的坐标。
值----------Value----------
A list of trip objects, named by the time boundary in which they lie.
一个行程对象列表,在它们所在的时间边界的名字命名。
(作者)----------Author(s)----------
Michael D. Sumner
参见----------See Also----------
See also tripGrid.
tripGrid。
实例----------Examples----------
set.seed(66)
d <- data.frame(x = 1:100, y = rnorm(100, 1, 10), tms = Sys.time() + c(seq(10,
1000, length = 50), seq(100, 1500, length = 50)), id = gl(2, 50))
coordinates(d) <- ~x+y
tr <- trip(d, c("tms", "id"))
bound.dates <- seq(min(tr$tms)-1, max(tr$tms)+1, length = 5)
trip.list <- trip.split.exact(tr, bound.dates)
bb <- bbox(tr)
cn <- c(20, 8)
g <- GridTopology(bb[,1], apply(bb, 1, diff) / (cn - 1), cn)
tg <- tripGrid(tr, grid = g)
tg <- as.image.SpatialGridDataFrame(tg)
tg$x <- tg$x - diff(tg$x[1:2])/2
tg$y <- tg$y - diff(tg$y[1:2])/2
op <- par(mfcol = c(4, 1))
for (i in 1:length(trip.list)) {
plot(coordinates(tr), pch = 16, cex = 0.7)
title(names(trip.list)[i], cex.main = 0.9)
lines(trip.list[[i]])
abline(h = tg$y, v = tg$x, col = "grey")
image(tripGrid(trip.list[[i]], grid = g), interpolate = FALSE, col =
c("white", grey(seq(0.2, 0.7, length = 256))), add =TRUE)
abline(h = tg$y, v = tg$x, col = "grey")
lines(trip.list[[i]])
points(trip.list[[i]], pch = 16, cex = 0.7)
}
par(op)
print("you may need to resize the window to see the grid data")
cn <- c(200, 80)
g <- GridTopology(bb[,1], apply(bb, 1, diff) / (cn - 1), cn)
tg <- tripGrid(tr, grid = g)
tg <- as.image.SpatialGridDataFrame(tg)
tg$x <- tg$x - diff(tg$x[1:2])/2
tg$y <- tg$y - diff(tg$y[1:2])/2
op <- par(mfcol = c(4, 1))
for (i in 1:length(trip.list)) {
plot(coordinates(tr), pch = 16, cex = 0.7)
title(names(trip.list)[i], cex.main = 0.9)
image(tripGrid(trip.list[[i]], grid = g, method = "density", sigma = 1),
interpolate = FALSE, col = c("white", grey(seq(0.2, 0.7, length = 256))), add =TRUE)
lines(trip.list[[i]])
points(trip.list[[i]], pch = 16, cex = 0.7)
}
par(op)
print("you may need to resize the window to see the grid data")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|