Learn R Programming

trip (version 1.8.5)

rasterize: Rasterize trip objects based on line-segment attributes.

Description

Trip rasterize.

Arguments

x

trip object

y

Raster* object

field

attribute from which differences will be calculated, defaults to the time-stamp between trip locations

Value

RasterLayer

Examples

Run this code
# NOT RUN {
 d <- data.frame(x=1:10, y=rnorm(10), tms=Sys.time() + 1:10, id=gl(2, 5))
sp::coordinates(d) <- ~x+y
## this avoids complaints later, but these are not real track data (!)
sp::proj4string(d) <- sp::CRS("+proj=laea +ellps=sphere", doCheckCRSArgs = FALSE)
tr <- trip(d, c("tms", "id"))

tr$temp <- sort(runif(nrow(tr)))
r <- rasterize(tr)

rasterize(tr, grid = r)
rasterize(tr, r, field = "temp")
# }
# NOT RUN {
rasterize(tr, method = "density")
rasterize(tr, method = "density", grid = r)

rasterize(tr, r, field = "tms")
rasterize(tr, r)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab