Learn R Programming

tbart (version 1.0)

star.diagram: Creates the lines for a 'star diagram'

Description

Creates the lines for a 'star diagram'

Usage

star.diagram(swdf1, swdf2, alloc)

Arguments

swdf1
- first Spatial* or Spatial*DataFrame objects
swdf2
- second Spatial* or Spatial*DataFrame objects (if omitted, defaults to the same value as swdf1)
alloc
- a list saying which coordinate in swdf2 is allocated to each point in swdf1 (if ommitted, looks for allocation column in swdf1)

Examples

Run this code
data(meuse)
coordinates(meuse) <- ~x+y
allocations.list <- allocate(meuse,p=5)
star.lines <- star.diagram(meuse,alloc=allocations.list)
plot(star.lines)

# Acquire allocations from swdf1
require(GISTools)
set.seed(461976) # Reproducibility
data(georgia)
georgia3 <- allocations(georgia2,p=8)
plot(georgia3,border='grey')
plot(star.diagram(georgia3),col='darkblue',lwd=2,add=TRUE)

Run the code above in your browser using DataLab