pop_gen: pop_gen

Description Usage Arguments Value Examples

View source: R/pop_gen.R

Description

Generates a fully synthetic mobile phone population and geographical area.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
pop_gen(
  tile.num,
  base.tile.size,
  city.num,
  city.size,
  city.shape = "SQUARE",
  hole.num,
  hole.size,
  hole.shape = "SQUARE",
  pop.dist.df
)

Arguments

tile.num

numeric value, number of tiles in total

base.tile.size

numeric value, size of tiles (possibly in meters, however in general without dimension)

city.num

numeric value, number of city clusters

city.size

numeric value, size of city cluster

city.shape

character value, the shape of the city cluster, either "SQUARE", ...

hole.num

numeric value, number of hole clusters

hole.size

numeric value, size of hole clusters

hole.shape

character value, the shape of the hole cluster, either "SQUARE", ...

pop.dist.df

tibble with 2 columns, "type" and "expression". See Details for further instructions

Value

A list object with 7 elements, 'area.params', containing the specified parameters, 'area.sf', the area tibble with geometry column (tile polygons), 'area.df', idential to the area tibble, however, without the geometry column, 'area.union' an sfc polygon object that contains the outter shape of the complete area 'area.bbox' named vector with boundary coordinates of the area 'area.raster' raster layer of the area with population values on the tile level 'area.elevation' raster layer of the area with elevation values on the tile level

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
tile.num <- 100 # number of tiles
base.tile.size <- 100 # size of a single tile
city.num <- 1 # number of single cities
city.size <- 10 # size of a single city polygon
hole.num <- 1 # number of single holes
hole.size <- 1 # size of a single hole polygon
pop.dist.df <- tibble::tibble(type = c("Urban", "Hole", "Rural"),
                              expression = c("ReIns::rtpareto(shape = 0.05, scale = 10, endpoint = 200",
                                             "ReIns::rtpareto(shape = 0.7, scale = 0.1, endpoint = 20",
                                             "ReIns::rtpareto(shape = 0.5, scale = 0.1, endpoint = 100"))
area <- pop_gen(tile.num, base.tile.size,
               city.num, city.size, city.shape = "SQUARE",
               hole.num, hole.size, hole.shape = "SQUARE",
               pop.dist.df)

R-ramljak/MNOanalyze documentation built on Dec. 18, 2021, 8:45 a.m.