Learn R Programming

BacArena (version 1.0.1)

addOrg: Add individuals to the environment

Description

The generic function addOrg adds individuals to the environment.

Usage

addOrg(object, specI, amount, x = NULL, y = NULL, growth = NA, mean = 0.489, sd = 0.132)
"addOrg"(object, specI, amount, x = NULL, y = NULL, growth = NA, mean = 0.489, sd = 0.132)

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.
growth
A numeric vector giving the starting biomass of the individuals.
mean
A numeric giving the mean of starting biomass (used for normal distribution) if growth is not defined
sd
A numeric giving the standard derivation of starting biomass (used for normal distribution) if growth is not defined

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

Run this code
data(Ec_core, envir = environment()) #get Escherichia coli core metabolic model
bac <- Bac(Ec_core,deathrate=0.05,
           growthlimit=0.05,growtype="exponential") #initialize a bacterium
arena <- Arena(n=20,m=20) #initialize the environment
addOrg(arena,bac,amount=10) #add 10 organisms

Run the code above in your browser using DataLab