Description Usage Arguments Details Value Examples
Sample dots from spatial polygons according to a spatial distribution of a population. The population may consist of classes. The output, an sf object containing spatial points, can be used to create a dot map (see tm_dots
), where the dots are colored according to the classes. Note that this function supports sf
objects, but still uses sp-based methods (see details).
1 2 3 4 5 |
shp |
A shape object, more specifically, a |
vars |
Names of one or more variables that are contained in |
convert2density |
Should the variables be converted to density values? Density values are used for the sampling algorithm, so use |
nrow |
Number of grid rows |
ncol |
Number of grid colums |
N |
Number of grid points |
npop |
Population total. If |
n |
Number of sampled dots |
w |
Number of population units per dot. It is the population total divided by |
shp.id |
Name of the variable of |
var.name |
Name of the variable that will be created to store the classes. The classes are defined by |
var.labels |
Labels of the classes (see |
target |
target unit, see |
randomize |
should the order of sampled dots be randomized? The dots are sampled class-wise (specified by |
output |
format of the output: use |
orig |
not used anymore as of version 2.0 |
to |
not used anymore as of version 2.0 |
... |
other arguments passed on to |
This function supports sf
objects, but still uses sp-based methods, from the packages sp, rgeos, and/or rgdal. Alternatively, st_sample
can be used.
A shape object, in the same format as shp
1 2 3 4 5 6 7 8 9 10 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.