Description Usage Arguments Details Value See Also Examples
Defines a stripe of a given density inside the population density object.
1 | set.stripe(dens, x1, y1, x2, y2, value = 0, width = 1)
|
dens |
object of class 'density.population´. |
x1 |
starting x-coordinate of stripe. |
y1 |
starting y-coordinate of stripe. |
x2 |
ending x-coordinate of stripe. |
y2 |
ending y-coordinate of stripe. |
value |
density value inside stripe area. |
width |
width of stripe. |
The x- and y-coordinates can lie outside the specified region. However, the stripe must cross this region. Since a region is divided into rectangular cells by the density matrix it can occur that the stripe covers some cells only partially (e.g. a stripe that runs diagonally through the region). In this case, a cell will be included if its centre lies inside the stripe area, otherwise not.
set.stripe
returns an object of class 'density.population´ which has the following elements:
n.interval.x |
number of x-intervals. |
n.interval.y |
number of y-intervals. |
matrix |
the (modified) density matrix. |
generate.region
to create region objects
generate.density
to create density objects
add.hotspot
to include spots of different densities
1 2 3 4 5 6 7 8 9 10 11 | # set zero stripe
reg<-generate.region(x.length = 50, y.width = 80)
dens <- generate.density(reg, nint.x = 50, nint.y = 40, southwest = 1, southeast = 10, northwest = 20)
dens <- set.stripe(dens, x1 = 30, y1 = -10, x2 = 10, y2 = 90, width = 4)
plot(dens, method="image")
# set rectangle with constant density
reg<-generate.region(x.length = 50, y.width = 80)
dens <- generate.density(reg, nint.x = 50, nint.y = 40, southwest = 1, southeast = 10, northwest = 20)
dens <- set.stripe(dens, x1 = 33, y1 = 40, x2 = 38, y2 = 10, value = 20, width = 12)
plot(dens)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.