Description Usage Arguments Value Author(s) Examples
Produces a specific SpatialPixelsDataFrame
of the given function for all nodes within a grid cell. Track information is lost.
1 2 3 4 | gridFlights(data, FUN, col.names = c("lon", "lat", "altitude"),
proj.in = "+init=epsg:4326",
proj.out = "+proj=utm +zone=32 +ellps=WGS84 +dataum=WGS84 +units=m +no_defs",
res.out = 1000, ...)
|
data |
the flights data.frame (at least with column names "lon", "lat" and "altitude") |
FUN |
function to apply |
col.names |
column names of the flights data.frame to use 1st for x-coordinate, 2nd for y-coordinate and 3rd for z-coordinate |
proj.in |
proj4string: projection of the input flights data.frame |
proj.out |
proj4string: projection of the output |
res.out |
output resulution in the unit of proj.out |
... |
further parameters passed to FUN |
a SpatialPixelsDataFrame
Joerg Steinkamp joergsteinkamp@yahoo.de
1 2 3 4 5 6 7 8 9 | library(raster)
extent <- extent(c(7.25, 8.5, 49.5, 50.2))
N <- 750
set.seed(987654)
data <- data.frame(lon=rbeta(N, 5, 2) * (extent@xmax - extent@xmin) + extent@xmin,
lat=rbeta(N, 2.5, 2.5) * (extent@ymax - extent@ymin) + extent@ymin)
data$altitude = (data$lon - 7.9)^3 - 3 * (data$lon - 7.9) * (data$lat- 50)^2
fgrid = gridFlights(data, min)
plot(fgrid)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.