R/getSpeciesSpecificAbundance.R

Defines functions getSpeciesSpecificAbundance

Documented in getSpeciesSpecificAbundance

getSpeciesSpecificAbundance <-
function(resultFileFolder,numTimepoints,outputPeriod)
{
	speciesAbundance<-NULL

	for(tp in seq(from=0,to=numTimepoints,by=outputPeriod))
	{
		# Read in the result
		xmlResultFile<-readSimResultFile(resultFileFolder,"agent_Sum",tp)

		allSpecies<-agent_returnSpeciesResultData(xmlResultFile)

		speciesCount<-NULL

		for(species in 1:agent_returnNumSpecies(allSpecies))
		{
			speciesCount<-cbind(speciesCount,agent_returnSpeciesColumnTotal(allSpecies,names(allSpecies)[species],"population"))
		}

		speciesAbundance<-rbind(speciesAbundance,speciesCount)
	}

	colnames(speciesAbundance)<-names(allSpecies)

	return(speciesAbundance)
}

Try the iDynoR package in your browser

Any scripts or data that you put into this service are public.

iDynoR documentation built on May 2, 2019, 5:56 a.m.