Description Usage Arguments Value Examples
NOT USED YET. I might not even need it. rtGetFromRecord() likely to be more useful.
rtGetFromGrid
allows access to population data from a grid of sexes and ages.
You can specify which [x,y,sex,age] you want to get data for.
Each variable defaults to 'all' so rtGetFromGrid(aGrid)
would return the whole grid.
='sum' can be used to sum across dimensions,
thus rtGetFromGrid(aGrid,x='sum',y='sum',sex='sum',age='sum')
would produce a single value of the total population on the grid.
1 | rtGetFromGrid(aGrid, y = "all", x = "all", sex = "all", age = "all")
|
aGrid |
an array with the age distributions of males & females [y,x,sex,age] |
y |
grid row number |
x |
grid column number |
sex |
'all' returns both sexes separately,'M','F', 'sum' sums sexes |
age |
'all' returns age distribution, 'sum' sums all ages, or an integer age ?or maybe an age range too |
an array, matrix or vector named with remaining dimensions of [y,x,sex,age]
1 2 3 4 5 6 7 8 | tst <- rt_runGrid()
aGrid <- tst['day2',,,,]
rtGetFromGrid(aGrid,x='sum',y='sum',sex='sum') #age structure for whole pop
rtGetFromGrid(aGrid,x='sum',y='sum',age='sum') #sex ratio for whole pop
#slight anomally this gives 4 grids
rtGetFromGrid(aGrid,x='all',y='all',age=c(1,2),sex='all')
#this gives just 1
rtGetFromGrid(aGrid,x='all',y='all',age=c(1,2),sex='sum')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.