set_macroareas: List of macroarea creator

Description Usage Arguments Value Methods (by generic) Examples

View source: R/state.R

Description

Function used to prepare and check list of macroareas to pass to macroarea as needed to create state objects.

Usage

1
2
3
4
5
6
7
## S3 method for class 'set_macroareas'
get_all_macroarea(x, ...)

set_macroareas(...)

## S3 method for class 'set_macroareas'
print(x, ...)

Arguments

x

an object used to select a method.

...

a set of macroareas.

Value

The list of macroareas provided.

Methods (by generic)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pavia  <- center('Pavia',  'Lombardia')
milano <- center('Milano', 'Lombardia')
lombardia <- region(set_centers(pavia, milano))

padova <- center('Padova', 'Veneto', 8, 0.7)
veneto <- region(set_centers(padova))

nitp <- macroregion('NITp', set_regions(lombardia, veneto))

torino   <- center('Torino', 'Piemonte', 7, 0.6)
piemonte <- region(set_centers(torino))

nord <- macroarea('Macroarea Nord',
  macroregions = set_macroregions(piemonte, nitp)
)

roma   <- center('Roma', 'Lazio', 10, 0.9)
lazio  <- region(set_centers(roma))

sud <- macroarea('Macroarea Sud',
  macroregions = set_macroregions(lazio)
)

get_all_macroarea(set_macroareas(nord, sud))
pavia     <- center('Pavia',   'Lombardia', offered = 5, p_accept = 0.6)
bergamo   <- center('Bergamo', 'Lombardia', 8)
milano    <- center('Milano',  'Lombardia', 10, 0.8)
lombardia <- region(set_centers(pavia, bergamo, milano), default_p = 0.7)

padova <- center('Padova', 'Veneto', 8, 0.7)
veneto <- region(set_centers(padova))

nitp <- macroregion('NITp', regions = set_regions(lombardia, veneto),
  initial_strip = c('lombardia', 'lombardia', 'veneto')
)

torino   <- center('Torino', 'Piemonte', 7, 0.6)
piemonte <- region(set_centers(torino))

nord <- macroarea('Macroarea Nord',
  macroregions = set_macroregions(piemonte, nitp)
)

roma   <- center('Roma', 'Lazio', 10, 0.9)
lazio  <- region(set_centers(roma))
sud    <- macroarea('Macroarea Sud',
  macroregions = set_macroregions(lazio)
)

set_macroareas(nord, sud)

UBESP-DCTV/clumpr documentation built on July 3, 2021, 11:23 p.m.