makestatkde: makestatkde

Description Usage Arguments Details Value Author(s) Examples

View source: R/repath.R

Description

Calculating Static KDE

Usage

1
makestatkde(pppm, f_sd1 = 4, sgdf, df, x = 1, y = 2, num)

Arguments

pppm

PointPattern object of Spatial Data

f_sd1

factor defining size of the first kernel, which generate the structure of dynamic kernel

sgdf

grid object to store results

df

data frame, containing coordinates of monuments

x

numeric, indicating column number of x coordinates

y

numeric, indicating column number of y coordinates

num

numeric, number of grid cells

Details

description of function

Value

SpatialGrid Object

Author(s)

Franziska Faupel <ffaupel@ufg.uni-kiel.de>

Oliver Nakoinz <oliver.nakoinz.i@gmail.com>

Hendrik Raese <h.raese@roots.uni-kiel.de>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Crating Test Data Randomly
testmatrix <- data.frame(x = abs(rnorm(100)*50), y = abs(rnorm(100)*50))
# Setting geographical frame
xmin    <- 0
xmax    <- max(testmatrix$x)
ymin    <- 0
ymax    <- max(testmatrix$y)
ext_ai <- raster::extent(xmin, xmax, ymin, ymax)

sv <- (xmax-xmin)/(ymax-ymin)
rw     <- 10   # width of raster defined in m

rows  <- round((ymax-ymin)/rw, 0) + 1                                    
colums <- round((xmax-xmin)/rw, 0) + 1                                      
v <- cbind(1:(colums*rows))                                              
df <- data.frame(v)                                                         
gt      <- sp::GridTopology(c(xmin, ymin), c(rw, rw), c(colums, rows))
sgdf    <- sp::SpatialGridDataFrame(gt, df)

pppm <- spatstat::ppp(testmatrix[,1], testmatrix[,2], 
                       window = spatstat::owin(
                       xrange=c(sgdf@bbox[1,1],sgdf@bbox[1,2]),
                       yrange=c(sgdf@bbox[2,1],sgdf@bbox[2,2]), 
                       unitname="m"))
                       
base_kde <- makestatkde(pppm, sgdf=sgdf, df=testmatrix, x=1, y=2, num=length(df[,1]))

ISAAKiel/pathARR documentation built on Sept. 10, 2021, 7:54 a.m.