generate.population: Defining an Animal Population

Description Usage Arguments Details Value See Also Examples

Description

This function uses the data stored in the 'pars.population´ object to create a new population object.

Usage

1
        generate.population(pars.population, seed = NULL)

Arguments

pars.population

An object created by the function setpars.population defining the parameters of the population.

seed

the number passed to set.seed() to initialise random number generator

Details

An animal population is generated as population object. generate.population works with the object 'pars.population´ that was generated by the function setpars.population. setpars.population has to be run prior.

Value

generate.population returns an object of class 'population´ which has the following elements:

region

object of class 'region´

groupID

vector of identification numbers for the animal groups.

posx

vector of x-positions of the animal groups.

posy

vector of y-positions of the animal groups.

groupsize

vector of sizes of the animal groups.

ntypes

number of possible type properties for the animal groups.

types

vector of type properties of the animal groups.

minexposure

lowest possible group exposure value.

maxexposure

highest possible group exposure value.

exposure

vector of exposure values of the animal groups.

parents

Details of WiSP objects passed to function

created

Creation date and time

seed

Equal to the argument 'seed' passed to the function

See Also

setpars.population, summary.population plot.population

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
reg <- generate.region(x.length = 50, y.width = 80)
     
# set up a linear density, add a hotspot and a stripe
dens <- generate.density(reg, nint.x = 50, nint.y = 40, southwest = 1, southeast = 10, northwest = 20)
dens<-add.hotspot(dens, 20,10, 100,10)
dens<-set.stripe(dens, 2,5, 50,70, value = 0, width = 10)
pop.pars<-setpars.population(density.pop = dens, number.groups = 100, size.method = "poisson",
                             size.min = 1, size.max = 5, size.mean = 1, exposure.method = "beta",
                             exposure.min = 2, exposure.max = 10, exposure.mean = 6, exposure.shape = 1)

pop <- generate.population(pop.pars)
summary(pop)
plot(pop)

dill/wisp documentation built on May 15, 2019, 8:31 a.m.