| discretize_classic | R Documentation | 
Discretize state-space grid, traps and initial activity center locations to prepare for using in discrete SCR model.
discretize_classic(X, grid, s.st, crs_, site, hab_mask = NULL)
X | 
 Either a matrix or array representing the coordinates of traps in UTMs. An array is used when traps are clustered over a survey area.  | 
grid | 
 A matrix or array object of the the state-space grid. This is 
returned from   | 
s.st | 
 A matrix of starting activity center coordinates. This is 
returned from   | 
crs_ | 
 The UTM coordinate reference system (EPSG code) used for your location provided as an integer (e.g., 32608 for WGS 84/UTM Zone 8N).  | 
site | 
 Either   | 
hab_mask | 
 Either   | 
This function prepares the state-space grid, trap coordinates and initial activity center coordinates for use in a discrete spatial capture-recapture model. Note that the number of rows in the state-space grid coordinate matrix will be reduced and this object will need to be adjusted before being used in the model.
grid Grid coordinates for the state-space.
nPix Number of state-space pixels.
X Discretized traps as a matrix or array.
s.st Indices for initial activity center locations.
The vector s.st returned from the function indexes the
rows of grid.
Daniel Eacker
# simulate a single trap array with random positional noise
x <- seq(-800, 800, length.out = 5)
y <- seq(-800, 800, length.out = 5)
traps <- as.matrix(expand.grid(x = x, y = y))
set.seed(200)
traps <- traps + runif(prod(dim(traps)),-20,20) 
mysigma = 300 # simulate sigma of 300 m
mycrs = 32608 # EPSG for WGS 84 / UTM zone 8N
# create state-space
Grid = grid_classic(X = traps, crs_ = mycrs, buff = 3*mysigma, res = 100)
# simulate data for uniform state-space and habitat mask
data3d = sim_classic(X = traps, ext = Grid$ext, crs_ = mycrs, sigma_ = mysigma,
prop_sex = 0.7,  N = 200, K = 4, base_encounter = 0.15, enc_dist = "binomial",
hab_mask = FALSE, setSeed = 100)
# total augmented population size 
M = 400
# get initial activity center starting values
s.st = initialize_classic(y=data3d$y, M=M, X=traps, ext=Grid$ext, 
                            hab_mask = FALSE)
# get discretized traps and initial activity center grid indices
d_list <- discretize_classic(X = traps, grid=Grid$grid, 
                     s.st = s.st, crs_= mycrs,hab_mask=NULL)
str(d_list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.