Learn R Programming

BacArena (version 1.0.1)

dat2mat: Function for transforming the organism data frame to a presence/absence matrix of organisms

Description

The generic function dat2mat simulates the event of mixing all substrates and organisms in the environment.

Usage

dat2mat(object)
"dat2mat"(object)

Arguments

object
An object of class Arena.

Value

Returns the presence/absence matrix of organisms on the grid based on the orgdat slot of the Arena class.

See Also

Arena-class and getSublb

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
occmat <- dat2mat(arena)
image(occmat)

Run the code above in your browser using DataLab