samplePoints: Take Point Observations from a spatial field.

Description Usage Arguments Value Examples

View source: R/samplePoints.R

Description

Takes binomial trials from a probability field created by simField randomly from points on the field.

Usage

1
samplePoints(field, N, M, replace = TRUE, times = NULL, ...)

Arguments

field

field object which simulated underlying data

N

int 1, Number of points to simulate

M

int, Number of trials for each point either 1 or N long

replace

logical, replace pixel probabilities in sampling?

times

vector of int, times to sample from

...

further argumnets for compatibility

Value

data.frame with observation number, number of trials, and the id of the pixel that the trail took place in.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(123)
unitSim <- simField(
    N = 300, 
    offset = c(0.1, 0.2), 
    max.edge = c(0.05,0.2),
    beta0 = -2,
    betaList = list(
        list(type="random", value=2),
        list(type="spatial", value=-.5),
        list(type="cluster", value=-2)
    ))

samplePoints(unitSim, N=20, M=100) 

nmmarquez/PointPolygon documentation built on Dec. 10, 2020, 1:15 a.m.