See the spatstat package, and function density.psp - you can control the
standard deviation of the kernel and the grid output.

library(spatstat)

?density.psp

example(density.psp)


A dummy example using shapefile data in the rgdal package:

library(rgdal)
library(maptools)
## data folder in rgdal
dsn <- system.file("vectors", package = "rgdal")[1]

## read a shapefile line "layer"
kiritimati_primary_roads <- readOGR(dsn=dsn,
layer="kiritimati_primary_roads")

## coerce to spatstat's psp object

psp.kpr <- as.psp(kiritimati_primary_roads)

## im object
dens <- density(psp.kpr)
plot(dens)

plot(psp.kpr, add = TRUE)

In package spatstat see vignette("shapefiles"), in sp see vignette("sp").
The maptools package also has an alternative for reading shapefiles and
provides methods for coercion between classes beyond those in each package
to and from the Spatial classes in sp.

Cheers, Mike.

On Fri, May 27, 2011 at 12:19 AM, Zev Ross <zev@zevross.com> wrote:

> Hi All,
>
> Has anyone done kernel density estimation on line "features" in R similar
> to what can be computed in ArcGIS (link below)? They have a kernel density
> for line features but it only supports one kernel function -- I'd like to
> experiment with different kernels.
>
> Zev
>
>
> http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/How_Kernel_Density_works/009z00000011000000/
>
> --
> Zev Ross
> ZevRoss Spatial Analysis
> 120 N Aurora, Suite 3A
> Ithaca, NY 14850
> 607-277-0004 (phone)
> 866-877-3690 (fax, toll-free)
> zev@zevross.com
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsumner@gmail.com

	[[alternative HTML version deleted]]

