Skip to content
Markus Kainu edited this page Oct 27, 2015 · 11 revisions

Analysis at subregional level

Currently country groupings are defined in ./run.R script. Each of the region:

  1. RAP
  2. REU
  3. RAF
  4. RNE
  5. GLO

Consists of subregions, meaning that we have two level hierarchy here. In the data.frame region_key membership in the regions is defined for each country in following manner:

| FAOST_CODE | RAF | RAF_Northern_Africa | RNE | RNE_Europe | GLO | GLO_Africa | | --- | --- | --- | --- | --- | --- | --- | --- | | EGY | TRUE | TRUE | FALSE | FALSE | TRUE | TRUE | | ITA | FALSE | FALSE | TRUE | TRUE | TRUE | FALSE | | USA | FALSE | FALSE | FALSE | FALSE | TRUE | FALSE | | CHN | FALSE | FALSE | FALSE | FALSE | TRUE | FALSE |

The real region_key data.frame has 40 columns, five macro regions as in the list above and varying number of subregions. Each variable name consists of abbreviation of the macro region as RAF and the name of the subregion separated by underscore _, for instance RAF_Northern_Africa. This naming scheme allows the extraction of macroregion and subregions for particular publication.

If object region_to_report has value RAF, the function subgrouping() will

  1. subset the columns that include RAF in the column names with FAOST_CODE column
  2. create a new column group based on the membership of each countries in the subregions
  3. return the data.frame of two columns FAOST_CODE and group as
FAOST_CODE group
EGY Northern Africa
ZAF Southern Africa

Based on that data we can

  1. exclude the non-African countries
  2. making comparisons, aggregations at the subregional level on the fly.

This is done automatically or on the fly so if you add a new subregions or if you move country from one subregions to another, the analysis are dynamically updated

Creating a new region with subregions

You define everything in the run.R script starting from row ~155.

  • You need to think of a abbreviation for your macro region like MED for Mediterranean countries.
  • You need to list the countries based on FAOST_CODE that belong to subgroups:
MED_Northern_shore <- c(203, # Spain
                        68,  # France
                        106, # Italy
                        198, # Slovenia
                        98 # Croatia
                         )
MED_Southern_shore <- c(143, # Morocco
                        124, # Libya
                        122, # Tunisia
                        4,   # Algeria
                        59  # Egypt
                         )
  • Then you have to specify of which subgroups MED group is constructed of
MED <- c(MED_Northern_shore,
         MED_Southhern_shore
         )

Once this is done, you have to add this information as a part of the region_key data.frame by creating dummy variables for each region/subregions that stated whether country belongs or not to that group.

region_key$MED                <- ifelse(region_key$FAOST_CODE %in% MED, TRUE, FALSE)
region_key$MED_Northern_shore <- ifelse(region_key$FAOST_CODE %in% MED_Northern_shore, TRUE, FALSE)
region_key$MED_Southern_shore <- ifelse(region_key$FAOST_CODE %in% MED_Southern_shore, TRUE, FALSE)

After defining these steps you can now rerun the script with region_to_report set to MED and get the report you like. Though, three extra steps remain,

  1. you must place
  2. you must specify the dimensions for map output around line 230 in input/syb_main.Rnw-file, and
  3. you must specify the subtitle for title page around line 555 in input/syb_main.Rnw-file

FAOSTAT regional aggregates

AreaCode AreaName
5000 World
5100 Africa
5101 Eastern Africa
5102 Middle Africa
5103 Northern Africa
5104 Southern Africa
5105 Western Africa
5200 Americas
5203 Northern America
5204 Central America
5206 Caribbean
5207 South America
5300 Asia
5301 Central Asia
5302 Eastern Asia
5303 Southern Asia
5304 South-Eastern Asia
5305 Western Asia
5400 Europe
5401 Eastern Europe
5402 Northern Europe
5403 Southern Europe
5404 Western Europe
5500 Oceania
5501 Australia & New Zealand
5502 Melanesia
5503 Micronesia
5504 Polynesia

syb.df regional aggregates

FAOST_CODE FAO_TABLE_NAME SHORT_NAME
5000 World World
5100 Africa Africa
5101 Eastern Africa Eastern Africa
5102 Middle Africa Middle Africa
5103 Northern Africa Northern Africa
5104 Southern Africa Southern Africa
5105 Western Africa Western Africa
5200 Americas Americas
5203 Northern America Northern America
5204 Central America Central America
5205 Latin America and the Caribbean Latin America and the Caribbean
5206 Caribbean Caribbean
5207 South America South America
5300 Asia Asia
5301 Central Asia Central Asia
5302 Eastern Asia Eastern Asia
5303 Southern Asia Southern Asia
5304 South-Eastern Asia South-Eastern Asia
5305 Western Asia Western Asia
5400 Europe Europe
5401 Eastern Europe Eastern Europe
5402 Northern Europe Northern Europe
5403 Southern Europe Southern Europe
5404 Western Europe Western Europe
5500 Oceania Oceania
5501 Australia and New Zealand Australia and New Zealand
5502 Melanesia Melanesia
5503 Micronesia Micronesia
5504 Polynesia Polynesia
5700 Developed Developed
5800 Developing Developing
5801 Least developed countries Least developed countries
5802 Landlocked developing countries Landlocked developing countries
5803 Small island developing States Small island developing States
5806 Asia excluding Japan Asia excluding Japan
5807 Oceania excluding Australia and New Zealand Oceania excluding Australia and New Zealand
5810 Sub-Saharan Africa Sub-Saharan Africa

SOFI aggregates

FAOST_CODE FAO_TABLE_NAME
5000 World
5100 Africa
5101 Eastern Africa
5102 Middle Africa
5104 Southern Africa
5105 Western Africa
5204 Central America
5205 Latin America and the Caribbean
5206 Caribbean
5207 South America
5300 Asia
5303 South Asia
5304 South East Asia
5500 Oceania
5801 Least developed countries
5802 Landlocked developing countries
5803 Small island developing States
5816 Low-income food-deficit economies
5834 East Asia
5851 Developed countries
5852 Developing countries
5853 Asia
5854 East Asia (excluding China)
5855 South Asia (excluding India)
5856 West Asia
5857 Caucasus and Central Asia
5858 Low-income economies
5859 Lower-middle-income economies
LACCaribbean Caribbean
LACCentralAmerica Central America
LACNorthAmerica North America
LACregion Regional Office for Latin America and the Caribbean
LACSouthAmerica South America
RAFCentralAfrica Central Africa
RAFEastAfrica Eastern Africa
RAFNorthAfrica North Africa
RAFregion Regional Office for Africa
RAFSouthernAfrica Southern Africa
RAFWestAfrica Western Africa
RAPCentralAsia Central Asia
RAPDeveloped Developed countries
RAPDevelopedCountries Developed countries
RAPDeveloping Developing countries
RAPEastAsia East Asia
RAPPacificIslands Pacific Islands
RAPregion Regional Office for Asia and the Pacific
RAPSoutheastAsia Southeast Asia
RAPSouthSouthwestAsia South and Southwest Asia
REUCaucAndTurkey REU Caucasus and Turkey
REUCentralAsia REU Central Asia
REUCentralEasternEurope REU Central Eastern Europe
REUCISeurope REU CIS Europe
REUIsrael Israel
REUOtherAndEFTA REU Other and EFTA
REUregion Regional Office for Europe and Central Asia
REUSouthEasternEurope REU South Eastern Europe
RNEgccsy Gulf Cooperation Council States and Yemen
RNEmaghreb Maghreb
RNEmashreq Mashreq
RNEregion Regional Office for the Near East
SOFILacReg SOFI Regional Office for Latin America and the Caribbean
SOFIRafReg SOFI Regional Office for Africa
SOFIRapReg SOFI Regional Office for Asia and the Pacific
SOFIReuReg SOFI Regional Office for Europe and Central Asia
SOFIRneReg SOFI Regional Office for Near East and North Africa

2015 regional aggregates

FAOST_CODE SHORT_NAME
11000 Regional Office for Latin America and the Caribbean
11001 Caribbean
11002 Central America
11003 North America
11004 South America
12000 Regional Office for Africa
12001 Central Africa
12002 Eastern Africa
12003 North Africa
12004 Southern Africa
12005 Western Africa
13000 Regional Office for Asia and the Pacific
13001 East Asia
13002 Pacific Islands
13003 Southeast Asia
13004 South and Southwest Asia
13005 Central Asia
13006 Australia New Zealand
13007 France
13008 Melanesia
13009 Micronesia
13010 Polynesia
13011 Russian Federation
13012 Southern Asia
13013 United States
13014 Western Asia
13100 Developed countries
13200 Developed countries
13300 Developing countries
14000 Regional Office for Europe and Central Asia
14001 REU Caucasus and Turkey
14002 REU Central Asia
14003 REU Central Eastern Europe
14004 REU CIS Europe
14005 Israel
14006 REU Other and EFTA
14007 REU South Eastern Europe
15000 Regional Office for the Near East
15001 Gulf Cooperation Council States and Yemen
15002 North Africa
15003 Other Near East countries

Table of Content

  • [Setting up the system](Setting up the system)

1. For collaborators

2. For users of yearbook process

Random

Data

  • automated data collection
  • manual data input

Publication

  • defining spreads
    • retrieving data
    • computations
    • defining object types
    • tailoring the uotput
  • covers, forewords etc.
  • metadata

Clone this wiki locally