Description Usage Arguments Details Value Author(s) References Examples
Kernel density estimation on roads using the function kde2d
from package MASS.
1 | road_kernel (count_path, roads_path, bandw = 500, group = "all")
|
count_path |
Path for the .csv file with the location of the observations. The file must have three headed columns (ID, x coordinate and y coordinate) with one observation per row. The coordinates must have the same projection as the roads shapefile. The header names are indiferent but the columns position must be as described. |
roads_path |
Path for the .shp file with the roads |
bandw |
Vector of bandwidths for x and y directions. A scalar value will be taken to apply to both directions. |
group |
String used to subset species/groups from the observations dataframe. Can be a single string or multiple strings. For multiple strings use: c("spe1", "spe2"). By default all observations are used. |
Observations are snaped to closest roads prior to estimation and the resulting kernel is clipped to the road. The kernel density estimation is rescaled to [0, 1] and recoded in three categories: 1 = 0.25 to 0.50, 2 = 0.50 to 0.75, 3 = 0.75 to 1
A SpatialPolygonsDataFrame object with the kernel density estimation
Bruno Silva
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.
1 2 3 | roads_path <- system.file("extdata/roads.shp", package = "roadHotspots")
count_path <- system.file("extdata/count.csv", package = "roadHotspots")
output <- road_kernel(count_path, roads_path)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.