Learn R Programming

seeg (version 1.0)

Spp: Spp Functions

Description

Functions for spatial analysis.

Usage

scan.geoeas.ppp(filename) 
 quad.chisq.ppp(dataset,target.intensity)
 quad.poisson.ppp(dataset,target.intensity)
 makeppp(dataset)
 nnGK.ppp(dataset)
 GKhat.env(n, s, hat, stat, win)
 nnGKenv.ppp(dataset,nsim)
 vario(dataset, num.lags, type='isotropic', theta, dtheta, maxdist)
 model.semivar.cov(var, nlags, n0, c0, a)
 img.map(map)

Arguments

filename
name of file to scan; in format GeoEAS
dataset
data frame with point pattern; coordinates x,y and values
target.intensity
target density or intensity of points
n
number of points
s
number of random patterns for envelope
hat
Estimated values of statistic
stat
statistic "G" or "K"
win
window to generate random patterns
nsim
number of random patterns for envelope
num.lags
number of lag intervals
type
omnidirectional (isotropic) or directional variogram
theta
direction angle for directional variograms
dtheta
bandwidth for directional variograms
maxdist
maximum distance for variogram calculations
var
calculated variogram
nlags
number of lag intervals
n0
estimated nugget
c0
estimated sill
a
estimated range
map
matrix reprsenting a raster map

Value

  • coord.varcoordinates and values of variable
  • pppsetdataset as ppp object
  • Xintnumber of points in each cell
  • intensitygrand mean of points per cell
  • chisqChisquare value; H0: pattern is not uniform
  • p.valuep-value; H0: pattern is not uniform
  • num.cellsnumber of cells in grid based on traget intensity
  • dfdegrees of freedom
  • dataset.vdataframe containing variogram
  • imgmatrix from map transposed and arranged and ready to apply function image

Details

Function scan.geoeas.ppp reads a GeoEAS file and makes a data frame. The GeoEAS format is from the U.S. EPA, Environmental Monitoring Systems Laboratory (Englund and Sparks, 1991). It includes point and grid specifications.

Function quad.chisq.ppp requires a point pattern and a target density. The function will define the number of cells in the grid based on the target intensity or density. Recall that chi-square requires 5 points per cell.

Function makeppp converts a dataframe into a ppp object.

Function nnGK.ppp uses makeppp, then calculates and plot Ghat, Khat and Lhat. It splits the screen such that we plot G on one top panel, and then divide the bottom panel in two to plot K and L side by side.

Function GKhat.env performs simulation of many random patterns and calculate the G and K metrics to determine an envelope (Kaluzny et al., 1996). The function will compute G or K for s Monte Carlo simulated random patterns generated with function runifpoint, then it plots the mean, low end and high end of the G or K for the simulated random pattern and compare to the empirical one. In turn the function nnGKenv.ppp uses makeppp and allows the application of the GKhat.env to a given spatial pattern dataset.

Function vario uses package sgeostat to analyze a marked pattern. Function vario( ) uses functions point( ) to generate a point object, plots it to visualize the point pattern, then uses command pair( ) to generate a point object and a pair object. The command pair ( ) requires us to define number of lags and the max dist. The pair object contains all pairs separated at each lag up to max distance. When applying command pair we can also decide the direction.

References

Acevedo M.F. 2013. "Data Analysis and Statistics for Geography, Environmental Science, and Engineering", CRC Press.

Englund, E., Sparks, A., 1991. GEO - EAS 1.2.1 GEOSTATISTICAL ENVIRONMENTAL ASSESSMENT SOFTWARE User's Guide. United States Environmental Protection Agency, Environmental Monitoring Systems Laboratory Las Vegas NV 89193-3478.

See Also

convert to ppp object ppp, plot plot, plot plot, sgeostat point, pair,

Examples

Run this code
unif100xy <- scan.geoeas.ppp("lab8/unif100geoEAS.txt")
unif100ppp <- ppp(unif100xy$x, unif100xy$y)
plot(unif100ppp$x,unif100ppp$y, xlab="x",ylab="y")
title("uni100xy",cex.main=0.8) 

pois100xy <- scan.geoeas.ppp("lab8/pois100geoEAS.txt")
pois100ppp <- ppp(pois100xy$x, pois100xy$y)
plot(pois100ppp$x,pois100ppp$y, xlab="x",ylab="y")
title("pois100xy",cex.main=0.8) 

quad100 <- quad.chisq.ppp(unif100xy,5)
pois100 <- quad.poisson.ppp(pois100xy,0.2)

nnGK.ppp(pois100xy)

pppG.env <- GKhat.env(n=200, s=20, G.u, stat="G", win=owin(c(0,1),c(0,1)))
nnGKenv.ppp (pois100xy,nsim=100)

xyz <- scan.geoeas.ppp("lab8/xyz-geoEAS.txt")
xyz.v <- vario(xyz,num.lags=10,type='isotropic', maxdist=0.45)
m.xyz.v <- model.semivar.cov(var=xyz.v, nlags=10, n0=0, c0=0.42, a=0.17)

Run the code above in your browser using DataLab