Learn R Programming

latticeDensity (version 1.2.7)

editLattice: Add or remove links in the lattice

Description

editLattice is an interactive editor based on the function edit.nb from the package spdep. A formLatticeOutput object includes an automatically generated neighborhood structure. Occasionally this will either leave two nodes disconnected that should be connected or vice versa. editLattice allows the user to directly edit the plot of the lattice using mouseclicks to add or remove neighbor links between nodes.

Usage

editLattice(formLatticeOutput)

Value

a formLatticeOutput object, which contains

  • EWlocs EW coordinates for use in contour.

  • NSlocs NS coordinates for use in contour.

  • nodes Matrix of node locations.

  • poly Matrix of vertices of the boundary polygon.

  • latt Lattice object as generated by dnearneigh of package spdep.

Arguments

formLatticeOutput

An object from formLattice or editLattice.

Author

Ronald P. Barry

See Also

formLattice

Examples

Run this code
plot.new()
data(polygon1)
nodeFillingOutput = nodeFilling(poly=polygon1, node_spacing=0.03)
plot(nodeFillingOutput)
formLatticeOutput = formLattice(nodeFillingOutput)
plot(formLatticeOutput)
if(interactive()){
formLatticeOutput = editLattice(formLatticeOutput)
}
#
Pointdata = splancs::csr(polygon1,20)
densityOut = createDensity(formLatticeOutput,PointPattern=Pointdata,
                  k=150,intensity=FALSE, sparse = TRUE)
plot(densityOut)

Run the code above in your browser using DataLab