addOrg: Add individuals to the environment

Description Usage Arguments Details See Also Examples

Description

The generic function addOrg adds individuals to the environment.

Usage

1
2
3
4
5
6
addOrg(object, specI, amount, x = NULL, y = NULL, biomass = NA,
  n0 = NULL, n = NULL, m0 = NULL, m = NULL)

## S4 method for signature 'Arena'
addOrg(object, specI, amount, x = NULL, y = NULL,
  biomass = NA, n0 = NULL, n = NULL, m0 = NULL, m = NULL)

Arguments

object

An object of class Arena.

specI

An object of class Organism.

amount

A numeric number giving the number of individuals to add.

x

A numeric vector giving the x positions of individuals on the grid.

y

A numeric vector giving the y positions of individuals on the grid.

biomass

A numeric vector giving the starting biomass of the individuals. (unit: fg)

n0

Start column of matrix to take free positions from (default 1)

n

End column of matrix to take free positions from (default arena@m)

m0

Start row of matrix to take free positions from (default 1)

m

End row of matrix to take free positions from (default arena@n)

Details

The arguments x and y should be in the same length as the number of organisms added (given by the argument amount).

See Also

Arena-class and Bac-class

Examples

1
2
3
4
5
data(Ec_core, envir = environment()) #get Escherichia coli core metabolic model
bac <- Bac(Ec_core,deathrate=0.05,
           minweight=0.05,growtype="exponential") #initialize a bacterium
arena <- Arena(n=20,m=20) #initialize the environment
arena <- addOrg(arena,bac,amount=10) #add 10 organisms

BacArena documentation built on May 29, 2017, 6:06 p.m.

Search within the BacArena package
Search all R packages, documentation and source code