scieee Science in your language
[en] (orig)

Appendix 4 to "The Status of Biological Invasions and their Management in South Africa in 2022"—Workflows

Author: SANBI; CIB
Publisher: Zenodo
DOI: 10.5281/zenodo.8217222
Source: https://zenodo.org/records/8217222/files/SANBI_and_CIB_(2023)_SBISA_in_2022_Appendix_4_Workflows.pdf
1
Appendix 4—Wo k lows
o he epo
“The s a us o biological in asions and hei managemen in Sou h A ica in 2022”
This appendix con ains wo k lows used in he epo ( he epo i sel is a ailable a
h p://dx.doi.o g/10.5281/zenodo.8217182)
Sugges ed ci a ion:
SANBI and CIB 2023. Appendix 4 o "The S a us o Biological In asions and hei Managemen in
Sou h A ica in 2022"—Wo k lows. Sou h A ican Na ional Biodi e si y Ins i u e, Ki s enbosch and
DSI-NRF Cen e o Excellence o In asion Biology, S ellenbosch.
h p://dx.doi.o g/10.5281/zenodo.8217222
Con en s:
In oduc ion pa hway p ominence ........................................................................................................ 2
T acking da a sou ces ......................................................................................................................... 106
Adding alien axa and en ichmen da a o he species lis ............................................................... 107
Upda ing he pe mi da abase ........................................................................................................... 112
Money spen ....................................................................................................................................... 117
Alien axa impac assessmen ............................................................................................................ 125
Sou cing, cap u ing, and epo ing in o ma ion o he P ince Edwa d Islands .............................. 127
2
In oduc ion pa hway p ominence
Sugges ed ci a ion: SANBI and CIB 2023. Appendix 4 o "The S a us o Biological In asions and hei
Managemen in Sou h A ica in 2022"—Wo k lows: In oduc ion pa hway p ominence. Sou h A ican
Na ional Biodi e si y Ins i u e, Ki s enbosch and DSI-NRF Cen e o Excellence o In asion Biology,
S ellenbosch. h p://dx.doi.o g/10.5281/zenodo.8217222
This wo k low can be used o p epa e, p ocess, and plo he socio-economic da a equi ed o
popula e he indica o in oduc ion pa hway p ominence. The indica o conce ns he pa hways ha
could acili a e he in oduc ion o alien species o a coun y om ano he egion. The indica o
conside s he oppo uni ies a ailable o in oduc ion (how ac i e he pa hways a e socio-
economically) and does no ake in o accoun how many in oduc ions occu as a esul o hose
oppo uni ies. Fo u he de ails see Wilson e al. (2018) and he ac shee o his indica o :
h ps://besjou nals.onlinelib a y.wiley.com/ac ion/downloadSupplemen ?doi=10.1111%2F1365-
2664.13251& ile=jpe13251-sup-0004-Ma e ialS4.docx. Pa hways a e as pe he Con en ion on
Biological Di e si y’s pa hway classi ica ion amewo k (CBD 2014). See Figu e 1 o an o e iew o
he wo k low.
1. Requi emen s
A s able in e ne connec ion, access o he p ocessed da a used in p e ious assessmen s o he
indica o , and access o published li e a u e is equi ed o ob ain he inpu da a o he wo k low. R
so wa e is equi ed o execu e he wo k low. The R code equi ed o his wo k low is p o ided in a
sepa a e R ma kdown documen . The p ocessed da a used in p e ious assessmen s should be sa ed
in a olde called ‘P ocessed_da a_p e ious_ epo ’.
3
Figu e 1. O e iew o he wo k low o he indica o in oduc ion pa hway p ominence. The s eps in
he box wi h he s ippled g ey line a e au oma ed. Au oma ed s eps a e pe o med in R, and de ails
on hese s eps and he equi ed R code a e p o ided in an accompanying R ma kdown documen .
2. Inpu s
Socio-economic da a o he in oduc ion pa hways and con e sion ac o ables o US$ a e he
equi ed inpu s. See below o de ails on how o ob ain hese inpu s.
2.1. Con e sion ac o ables
Con e sion ac o ables a e equi ed o adjus ime se ies da a in cu en US$ o in la ion.
Con e sion ac o ables can be ob ained online:
h ps://libe ala s.o egons a e.edu/spp/polisci/ esea ch/in la ion-con e sion- ac o s. The ables
p o ided a he sugges ed websi e p esen p edic ed alues o 2018 onwa ds. These can be
eplaced wi h ac ual alues using in o ma ion om:
h ps://www.bls.go /da a/in la ion_calcula o .h m.
2.2. Socio-economic da a o pa hways
Socio-economic da a o in oduc ion pa hways can be ob ained om he published pee - e iewed
and g ey li e a u e, and downloaded om online da abases.
Pee e iewed o g ey li e a u e published since he cu -o da e o he p e ious assessmen (e.g. 31
Decembe 2016 o he i s assessmen in Sou h A ica) up un il he cu -o da e o he cu en
assessmen (e.g. 31 Decembe 2019 o he second assessmen in Sou h A ica) mus be sea ched o
ele an in o ma ion. This could, o example, be in o ma ion on he ade in alien species published
in esea ch on he pe ade and o namen al plan ade, in o ma ion on he numbe o biological
con ol agen s unde e alua ion, and epo s o o he o icial documen s. Examples om Sou h
4
A ica include he Na ional Po s Plans by he T ansne Na ional Po s Au ho i y, he Sou h A ican
G ain Seeds Ma ke Repo by he Depa men o Ag icul u e, Land Re o m and Ru al De elopmen ,
and he S a e o he Wo ld’s Fishe ies and Aquacul u e by he Food and Ag icul u e O ganisa ion o
he Uni ed Na ions.
Socio-economic da a o many pa hways can be downloaded om he websi es o in e na ional and
na ional o ganisa ions. These da a a e o en open-access. All da a a ailable a e downloaded (i.e.
da a o all yea s), as his allows o change o e ime o be acked. Da a o he pe iod be o e he
da a cu o poin o he assessmen (e.g. Decembe 2019 o he second assessmen in Sou h
A ica) a e equi ed, bu da a up un il his poin may no be a ailable in all da ase s. This is because
some da ase s a e upda ed less equen ly han he indica o is upda ed.
C ea e a olde ‘Inpu s’ o s o e he unedi ed e sions o he downloaded da a. The name o he
sa ed ile mus con ain in o ma ion on he pa hway, he da abase he da a we e downloaded om,
and he da e he da a we e downloaded. In ins ances whe e da a o speci ic pe iods o ime a e
downloaded in sepa a e iles, he ile name mus addi ionally con ain in o ma ion on he pe iod o
which he da a we e downloaded.
Below a e de ails on he s eps ha a e ollowed o ob ain online da a ha ha e been used in
assessmen s o biological in asions in Sou h A ica. Examples o ile names a e also p o ided.
2.2.1 S owaway: Land ehicles
Da a a e downloaded om he Uni ed Na ions Com ade da abase (h ps://com adeplus.un.o g/).
These a e da a on he yea ly alue o ehicle impo s o Sou h A ica om he es o he wo ld. The
da a a e in US$. A cs ile con aining he da a is downloaded.
Login using a google accoun .
Selec ‘Da a’ a he op o he sc een, and hen ‘T ade da a’ om he d op-down menu.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Type o p oduc : goods
F equency: annual
Classi ica ion: HS (as epo ed)
HS (as epo ed commodi y codes):
87: Vehicles; o he han ailway o amway olling s ock, and pa s and accesso ies he eo
86: 'Railway o amway locomo i es, olling-s ock and pa s he eo
Repo e s: Sou h A ica
T ade lows: Impo
Pe iods: Selec each yea o which da a a e equi ed
Pa ne s: Wo ld
Modes o anspo : TOTAL modes o anspo
2
nd
pa ne : Wo ld
Cus oms code: TOTAL cus oms p ocedu e codes
B eakdown mode: Classic
Agg ega e by: None
File name: S owaway_land_ ehicles_COMTRADE_day_mon h_yea (e.g.
S owaway_land_ ehicles_COMTRADE_08_03_2021)
5
2.2.2 Escape: Ho icul u e; Con aminan : Con aminan nu se y ma e ial; Con aminan : Con aminan
on plan s; Con aminan : Pa asi e on plan s
Da a a e downloaded om he Uni ed Na ions Com ade da abase (h ps://com adeplus.un.o g/).
These a e da a on he yea ly alue o li e plan impo s o Sou h A ica om he es o he wo ld.
These da a a e in US$. A cs ile con aining he da a is downloaded.
Login using a google accoun .
Selec ‘Da a’ a he op o he sc een, and hen ‘T ade da a’ om he d op-down menu.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Type o p oduc : goods
F equency: annual
Classi ica ion: HS (as epo ed)
HS (as epo ed commodi y codes):
06: T ees and o he plan s, li e; bulbs, oo s and he like; cu lowe s and o namen al oliage
Repo e s: Sou h A ica
T ade lows: Impo
Pe iods: Selec each yea o which da a a e equi ed
Pa ne s: Wo ld
Modes o anspo : TOTAL modes o anspo
2
nd
pa ne : Wo ld
Cus oms code: TOTAL cus oms p ocedu e codes
B eakdown mode: Classic
Agg ega e by: None
File name: Escape_Con aminan _plan s_COMTRADE_day_mon h_yea (e.g.
Escape_Con aminan _plan s_COMTRADE_08_03_2021)
2.2.3 Escape: Fa med animals
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e da a on he numbe o animals, o
a ious ypes (ca le, ho ses pigs e c), p oduced yea ly in Sou h A ica. A cs ile con aining he da a
is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
P oduc ion: C ops and li es ock p oduc s
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: S ocks
I ems: Li e animals
Yea s: Selec all
File name: Escape_Fa med_animals_FAOSTAT_day_mon h_yea (e.g.
Escape_ a med_animals_FAOSTAT_09_03_2021)
2.2.4. Con aminan : Con aminan on animals; Con aminan : Pa asi es on animals
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e da a on he numbe o li e

6
animals, o a ious ypes, impo ed yea ly in o Sou h A ica. A cs ile con aining he da a is
downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
T ade: C ops and li es ock p oduc s
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: Impo quan i y
I ems: Li e animals
Yea s: Selec all
File name: Con aminan _animals_FAOSTAT_day_mon h_yea (e.g.
Con aminan _animals_FAOSTAT_09_03_2021)
2.2.5. Escape: Fo es y
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e da a on he quan i y o o es y
p oduc s p oduced yea ly in Sou h A ica. A cs ile con aining he da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Fo es y: o es y p oduc ion and ade
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: P oduc ion quan i y
I ems: Selec all
Yea s: Selec all
File name: Escape_ o es y_FAOSTAT_day_mon h_yea (e.g.
Escape_ o es y_FAOSTAT_09_03_2021)
2.2.6. Con aminan : Timbe ade
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e da a on he alue o o es y
impo s o Sou h A ica each yea in 1000 US$. A cs ile con aining he da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Fo es y: o es y p oduc ion and ade
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: Impo alue
I ems: Selec all
Yea s: Selec all
File name: Con aminan _ imbe _FAOSTAT_day_mon h_yea (e.g.
Con aminan _ imbe _FAOSTAT_10_03_2021)
7
2.2.7. Con aminan : Food con aminan
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e da a on he quan i y o a ious
ypes o ood impo ed o Sou h A ica each yea , in 1000 onnes. A cs ile con aining he da a is
downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Food balances (2010-)
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: Impo quan i y
I ems: Selec all
Yea s: Selec all
File name: Con aminan _ ood_FAOSTAT_day_mon h_yea (e.g.
Con aminan _ ood_FAOSTAT_10_03_2021)
2.2.8. Escape: Ag icul u e
Da a a e downloaded om he FAOs a da abase o he Food and Ag icul u al O ganisa ion o he
Uni ed Na ions (h p://www. ao.o g/ aos a /en/#da a). These a e yea ly da a on he quan i y o
c ops p oduced (in onnes) and he a ea ha es ed (in ha) in Sou h A ica. A cs ile con aining he
da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
• P oduc ion: C ops and li es ock p oduc s
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Coun ies: Sou h A ica
Elemen s: P oduc ion quan i y AND A ea ha es ed
I ems: C ops P ima y
Yea s: Selec all
File name: Escape_ag icul u e_FAOSTAT_day_mon h_yea (e.g.
Escape_ag icul u e_FAOSTAT_10_03_2021)
2.2.9. S owaway: People and hei luggage
Da a a e downloaded om he Wo ld Tou ism and T a el Council
(h ps://w c.o g/Resea ch/Economic-Impac /Da a-Visualisa ion). These a e da a on he o al
con ibu ion o ou ism and a el o Sou h A ica’s GDP each yea . Da a a e in bn US$ a eal p ices.
A cs ile con aining he da a is downloaded.
[No e: The websi e o he WTTC is being upda ed, and his in o ma ion will need o be upda ed once
i is up]
File name: S owaway_people_WTTC_day_mon h_yea (e.g. S owaway_people_WTTC_10_03_2021).
2.2.10. S owaway: Con aine /bulk
8
Da a a e downloaded om he T ansne Na ional Po s Au ho i y
(h p://www. ansne na ionalpo sau ho i y.ne /Comme cial%20and%20Ma ke ing/Pages/Po -
S a is ics.aspx). These a e da a on he numbe o deepsea con aine s landed a Sou h A ican po s.
Da a a e a ailable o each mon h o yea . Yea ly da a a e equi ed, so i he da a o each mon h is
downloaded, hen wo k is equi ed o ge he yea ly alues (see below). Pd (s) con aining he da a is
downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
TEUs: Selec he alue o he pe iod o in e es (e.g. Calenda yea 2020)
File name: S owaway_ca go_Yea _TRANSNET_day_mon h_yea (e.g.
S owaway_ca go_2020_TRANSNET_04_03_2021), OR
S owaway_ca go_Mon hYea _TRANSNET_day_mon h_yea (e.g.
S owaway_ca go_Jan2020_TRANSNET_04_03_2021).
2.2.11. S owaway: Ship/boa hull ouling; S owaway: Ship/boa ballas wa e ; S owaway: Hi chhike s
on ship/boa ; S owaway: Angling/ ishing equipmen
Da a a e downloaded om he T ansne Na ional Po s Au ho i y
(h p://www. ansne na ionalpo sau ho i y.ne /Comme cial%20and%20Ma ke ing/Pages/Po -
S a is ics.aspx). These a e da a on he numbe o essel a i als a Sou h A ican po s. Da a a e
a ailable o each mon h o yea . Yea ly da a a e equi ed, so i he da a o each mon h is
downloaded, hen wo k is equi ed o ge he yea ly alues (see below). Pd (s) con aining he da a is
downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Vessels A i als: Selec he alue o he pe iod o in e es (e.g. Calenda yea 2020)
File name: S owaway_ship_Yea _TRANSNET_day_mon h_yea (e.g.
S owaway_ship_2020_TRANSNET_04_03_2021), OR
S owaway_ship_Mon hYea _TRANSNET_day_mon h_yea (e.g.
S owaway_ship_Jan2020_TRANSNET_04_03_2021).
2.2.12. S owaway: People and hei luggage/equipmen ; S owaway: Vehicles
Da a a e downloaded om S a is ics Sou h A ica
(h p://www.s a ssa.go .za/?page_id=1866&PPN=P0351&SCH=6717&page=1). These a e mon hly
da a on ou ism and mig a ion o Sou h A ica. A pd ile con aining he da a o each mon h is
downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
A chi ed publica ions o P0351: Selec he da a o he mon h o in e es (e.g. P0351 - Tou ism and
Mig a ion, Decembe 2020)
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Main publica ion: Download he en i e publica ion
File name: S owaway_people_ ehicles_Mon hYea _STATSSA_day_mon h_yea (e.g.
S owaway_people_ ehicles_Jan2019_STATSSA_11_03_2021).
2.2.13. S owaway: Ai plane
9
Da a a e downloaded om Ai po s Company Sou h A ica
(h p://www.ai po s.co.za/business/s a is ics/ai c a -and-passenge ). These a e da a on he o al
consolida ed ai c a mo emen s a ACSA un ai po s each inancial yea . A pd ile con aining he
da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Passenge and ai c a cha s: Ai po Company Sou h A ica To al Consolida ed Ai c a Mo emen s
File name: S owaway_ai plane_ACSA_day_mon h_yea (e.g.
S owaway_ai plane_ACSA_12_03_2021).
2.2.14. Escape: Resea ch
Da a a e downloaded om CITES (h ps:// ade.ci es.o g/). These a e da a on he numbe o li e
animals impo ed each yea o Sou h A ica o scien i ic pu poses, b eeding in cap i i y o a i icial
p opaga ion pu poses. A cs ile con aining he da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Yea ange: selec yea s o in e es (e.g. om: 2005; o: 2020)
Expo ing coun ies: All coun ies
Impo ing coun ies: Sou h A ica
Sou ce: All sou ces
Pu pose: B-B eeding in cap i i y o a i icially p opaga ion AND S-Scien i ic
T ade e ms: LIV-Li e
Sea ch by Taxon: lea e blank
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Selec ou pu ypes: comma sepa a ed
Selec epo ype: G oss/Ne T ade Tabula ions: G oss impo s
File name: Escape_ esea ch_CITES_day_mon h_yea (e.g. Escape_ esea ch_CITES_12_03_2021).
2.2.15. Escape: Pe
Da a a e downloaded om CITES (h ps:// ade.ci es.o g/). These a e da a on he numbe o li e
animals impo ed o Sou h A ica o comme cial o pe sonal pu poses each yea . A cs ile
con aining he da a is downloaded.
The ollowing selec ions need o be made on he webpage o download he co ec da a:
Yea ange: selec yea s o in e es (e.g. om: 2005; o: 2020)
Expo ing coun ies: All coun ies
Impo ing coun ies: Sou h A ica
Sou ce: All sou ces
Pu pose: P-Pe sonal AND T-Comme cial
T ade e ms: LIV-Li e
Sea ch by Taxon: lea e blank
This selec ion will ake you o a second webpage whe e he ollowing selec ions need o be made o
download he co ec da a:
Selec ou pu ypes: comma sepa a ed
Selec epo ype: G oss/Ne T ade Tabula ions: G oss impo s
16
In his au oma ed s ep (Figu e 1), da a ha a e in sho - o m a e con e ed o long o m,
unnecessa y ows o columns in he da ase s a e emo ed, da a ha a e p o ided a a highe le el o
de ail han equi ed a e agg ega ed, and he mos ecen da a a e checked o issues and
adjus men s made whe e equi ed. The de ails and R code equi ed o p e-p ocess he socio-
economic da a ha ha e been used in assessmen s o biological in asions in Sou h A ica a e
p o ided in an accompanying R ma kdown documen .
3.4. P ocessing
Du ing his au oma ed s ep (Figu e 1) he da a a e plo ed, compa ed o he da a used in he mos
ecen assessmen o he indica o , and calcula ions a e done o de e mine he pe cen age change
in he da a since he p e ious assessmen . This s ep p o ides in o ma ion o es ima ing he
indica o in oduc ion pa hway p ominence, and acking change in he indica o . The de ails and R
code equi ed o p ocess he socio-economic da a ha ha e been used in assessmen s o biological
in asions in Sou h A ica a e p o ided in an accompanying R ma kdown documen .
3.5. Pos -p ocessing
The p ocessed da a a e expo ed in cs o ma , in o ma ion equi ed o ack change a e sa ed in a
dedica ed cs ile, and plo s a e expo ed as i s (Figu e 1). All ou pu s a e sa ed in he olde
‘P ocessed’ c ea ed du ing au oma ed s eps o his wo k low. The p ocessed da a a e expo ed o
he ‘P ocessed_da a’ sub- olde in he ‘P ocessed’ olde , he plo s a e expo ed o he ‘Plo s’ sub-
olde in he ‘P ocessed’ olde , and he in o ma ion equi ed o ack change a e sa ed in he ile
‘Change_ acking.cs ’ ound in he ‘P ocessed’ olde . The de ails and R code equi ed o his
au oma ed s ep o expo he ou pu s used in assessmen s o biological in asions in Sou h A ica a e
p o ided in an accompanying R ma kdown documen .
4. Ou pu s
Fo each pa hway, he ou pu s o his wo k low (Figu e 1) and o he socio-economic da a collec ed
on he pa hway h ough li e a u e sea ches and om expe s a e used by an expe o classi y he
in oduc ion oppo uni ies p o ided by he pa hway in o i e ca ego ies o in oduc ion pa hway
p ominence, and ack change. Con idence in he o e all assessmen as well as ha o each
pa hway is also es ima ed. Fo de ails on calcula ion p ocedu es and es ima ing con idence limi s
see he ac shee o his indica o :
h ps://besjou nals.onlinelib a y.wiley.com/ac ion/downloadSupplemen ?doi=10.1111%2F1365-
2664.13251& ile=jpe13251-sup-0004-Ma e ialS4.docx
5. Re e ences
CBD (2014) Pa hways o in oduc ion o in asi e species, hei p io i iza ion and managemen .
Mon eal A ailable om: h ps://www.cbd.in /doc/mee ings/sbs a/sbs a-18/o icial/sbs a-
18-09-add1-en.pd (Feb ua y 7, 2019).
Wilson JRU, Faulkne KT, Rahlao SJ, Richa dson DM, Zengeya TA, an Wilgen BW (2018) Indica o s
o moni o ing biological in asions a a na ional le el. Jou nal o Applied Ecology 55: 2612–
2620. h ps://doi.o g/10.1111/1365-2664.13251

17
6. R-ma kdown code
Ka elyn Faulkne
05/05/2023
Con e sion ac o ables and socio-economic da a a e ob ained om a ious sou ces o popula e he
indica o : In oduc ion Pa hway P ominence. The wo k low o his indica o includes manually
p epa ing some o he da a o p ocessing (e.g. dige ising da a). This documen con ains he R code
o he au oma ed p ocesses o he wo k low. The R code was speci ically de eloped o p ocess he
da a ob ained o assessmen s o biological in asions in Sou h A ica, bu he s eps will be
app op ia e elsewhe e, and he code can be adap ed.
No e ha he ile names o he cs s used in he code in his documen will need o be edi ed. This is
because hese ile names include he da e he da a we e downloaded.
See he pd on he wo k low o u he de ails.
Se wo king di ec o y
The olde se as he wo king di ec o y mus con ain he olde s c ea ed in ea lie s eps o he
wo k low (e.g. ‘Inpu s’ and ‘P epa ed_inpu s’). See pd on he wo k low o u he de ails.
The unc ion se wd() is used o se he wo king di ec o y. Pas e he ile pa h o you wo king
di ec o y in he quo a ion ma ks in he code chuck below (i.e. eplace he ile pa h in he b acke s
wi h ha o you wo king di ec o y). Inse double backslashes whe e equi ed.
se wd("C: Na ional_S a us_Repo _2023 In oduc ion_pa hway_p ominence")
C ea e olde s o ou pu s
C ea e a olde o all p ocessed iles o he ou pu s o he au oma ed pa o he wo k low. This
olde will be in you wo king di ec o y.
di .c ea e("P ocessed")
C ea e a sub- olde o plo s. This sub- olde will be in he “P ocessed” olde c ea ed using he
abo e chunk o code.
di .c ea e("P ocessed//Plo s")
C ea e a sub- olde o p ocessed da a. This sub- olde will be in he “P ocessed” olde c ea ed
using he abo e chunk o code.
di .c ea e("P ocessed//P ocessed_da a")
C ea e a cs ile o ou pu s on change
This is an emp y cs ile o which ou pu s ha will assis wi h acking changes o he indica o will
be w i en. This ile will be in he “P ocessed” olde c ea ed using he abo e chunk o code.
names<-da a. ame(ma ix(ncol=4,n ow=0, dimnames=lis (NULL, c("Pa hway",
"ChangeScena io", "Pe cen ageChange", "BaseChange"))))
w i e.cs (names, "P ocessed//Change_ acking.cs ", ow.names = FALSE)
Read da a
18
Read da a ha we e manually p epa ed
Manually p epa ed da a we e sa ed as cs iles in he “P epa ed_inpu s” olde in he wo king
di ec o y. See he pd on he wo k low o u he de ails.
# ge he lis o iles
lis . iles("P epa ed_inpu s", pa e n = ".cs ")
## [1] "Con aminan _seeds_DALRRD_p epa ed.cs "
## [2] "Con e sion_ ac o _2017USD.cs "
## [3] "S owaway_ai plane_ACSA_p epa ed.cs "
## [4] "S owaway_ca go_TRANSNET_p epa ed.cs "
## [5] "S owaway_ ishing_TRANSNET_p epa ed.cs "
## [6] "S owaway_people_ ehicles_STATSSA_p epa ed.cs "
## [7] "S owaway_ship_TRANSNET_p epa ed.cs "
## [8] "Unaided_IMF_p epa ed.cs "
Read in each o he iles, gi ing each a meaning ul name. The assigned name should indica e he
pa hway o which he da a a e ele an . No e he assigned names mus be unique, and will be used
in subsequen s eps o he wo k low.
In he code chunk below, o each ile, pas e he ile name in he quo a ion ma ks a e
“P epa ed_inpu s ”. See below o examples.
# con e sion ac o able
CFDa <- ead.cs ("P epa ed_inpu s Con e sion_ ac o _2017USD.cs ")
# ai plane da a om acsa
S owAi <- ead.cs ("P epa ed_inpu s S owaway_ai plane_ACSA_p epa ed.cs ")
# ca go da a om T ansne
S owCa go<- ead.cs ("P epa ed_inpu s S owaway_ca go_TRANSNET_p epa ed.cs ")
# ishing essel da a om T ansne
S owFishVes<- ead.cs ("P epa ed_inpu s S owaway_ ishing_TRANSNET_p epa ed.cs ")
# mig a ion da a om S a sSA
S owPeopVeh<- ead.cs ("P epa ed_inpu s S owaway_people_ ehicles_STATSSA_p epa ed.cs ")
# ship a i al da a om T ansne
S owShip<- ead.cs ("P epa ed_inpu s S owaway_ship_TRANSNET_p epa ed.cs ")
# Me chandise impo da a o con inen al A ican coun ies om IMF
UnaidedIMF<- ead.cs ("P epa ed_inpu s Unaided_IMF_p epa ed.cs ")
# Seed impo da a om DALRRD
Con Seed<- ead.cs ("P epa ed_inpu s Con aminan _seeds_DALRRD_p epa ed.cs ")
Read da a ha did no equi e manual p epa a ion
These da a we e sa ed as cs iles in he “Inpu s” olde in he wo king di ec o y. See he pd on he
wo k low o u he de ails.
19
# ge he lis o iles
lis . iles("Inpu s", pa e n = ".cs ")
## [1] "Con aminan _animals_FAOSTAT_21_04_2023.cs "
## [2] "Con aminan _ ood_FAOSTAT_21_04_2023.cs "
## [3] "Con aminan _ imbe _FAOSTAT_21_04_2023.cs "
## [4] "Escape_ag icul u e_FAOSTAT_21_04_2023.cs "
## [5] "Escape_aquacul u e_FISHSTATJ_21_04_2023.cs "
## [6] "Escape_bo ga den_zoo_CITES_21_04_2023.cs "
## [7] "Escape_Con aminan _plan s_COMTRADE_21_04_2023.cs "
## [8] "Escape_ a med_animals_FAOSTAT_21_04_2023.cs "
## [9] "Escape_ o es y_FAOSTAT_21_04_2023.cs "
## [10] "Escape_pe _CITES_21_04_2023.cs "
## [11] "Escape_ esea ch_CITES_21_04_2023.cs "
## [12] "S owaway_ ishing_FISHSTATJ_21_04_2023.cs "
## [13] "S owaway_land_ ehicles_COMTRADE_21_04_2023.cs "
## [14] "S owaway_people_WTTC_23_08_2019.cs "
## [15] "Unaided_WTO_21_04_2023.cs "
Read in each o he iles, gi ing each a meaning ul name. The assigned name should indica e he
pa hway o which he da a a e ele an . No e he assigned names mus be unique, and will be used
in subsequen s eps o he wo k low.
In he code chunk below, o each ile, pas e he ile name in he quo a ion ma ks a e “Inpu s ”.
See below o examples.
# animal impo da a om he FAO
Con Ani<- ead.cs ("Inpu s Con aminan _animals_FAOSTAT_21_04_2023.cs ")
# ood impo da a om he FAO
Con Food<- ead.cs ("Inpu s Con aminan _ ood_FAOSTAT_21_04_2023.cs ")
# imbe impo da a om he FAO
Con Timb<- ead.cs ("Inpu s Con aminan _ imbe _FAOSTAT_21_04_2023.cs ")
# animal impo da a om he FAO
Con Ani<- ead.cs ("Inpu s Con aminan _animals_FAOSTAT_21_04_2023.cs ")
# ag icul u e p oduc ion da a om he FAO
EscAg i<- ead.cs ("Inpu s Escape_ag icul u e_FAOSTAT_21_04_2023.cs ")
# aquacul u e p oduc ion da a om FishS a J
EscAqua<- ead.cs ("Inpu s Escape_aquacul u e_FISHSTATJ_21_04_2023.cs ")
# animal impo s o bo anical ga dens and zoos om CITES
EscBo Zoo<- ead.cs ("Inpu s Escape_bo ga den_zoo_CITES_21_04_2023.cs ")
# plan impo da a om he Com ade
EscCon Plan <- ead.cs ("Inpu s Escape_Con aminan _plan s_COMTRADE_21_04_2023.cs ")
# a m animal p oduc ion da a om he FAO
EscFa m<- ead.cs ("Inpu s Escape_ a med_animals_FAOSTAT_21_04_2023.cs ")
20
# o es y p oduc ion da a om he FAO
EscFo es <- ead.cs ("Inpu s Escape_ o es y_FAOSTAT_21_04_2023.cs ")
# da a on o ganisms impo ed o pe sonal o comme cial easons om CITES
EscPe <- ead.cs ("Inpu s Escape_pe _CITES_21_04_2023.cs ")
# da a on o ganisms impo ed o esea ch om CITES
EscRes<- ead.cs ("Inpu s Escape_ esea ch_CITES_21_04_2023.cs ")
# ishing ca ch da a om FishS a J
S owFishCa ch<- ead.cs ("Inpu s S owaway_ ishing_FISHSTATJ_21_04_2023.cs ")
# ehicle impo da a om Com ade
S owLand<- ead.cs ("Inpu s S owaway_land_ ehicles_COMTRADE_21_04_2023.cs ")
# impo s da a o A ica om WTO
UnaidedWTO<- ead.cs ("Inpu s Unaided_WTO_21_04_2023.cs ")
# ou ism da a om WTTC
S owPeopWTTC<- ead.cs ("Inpu s S owaway_people_WTTC_23_08_2019.cs ")
All he equi ed iles we e ead in o R du ing he p e ious s ep. In he subsequen s eps each ile is
p ocessed sepa a ely, ollowing he emaining s eps o he au oma ed pa o he wo k low:
s anda disa ion, p e-p ocessing, p ocessing, pos -p ocessing.
See below o he de ailed s eps o each o he da ase s ob ained o assessmen s o biological
in asions in Sou h A ica.
S owaway: Land ehicles (Com ade)
Da a on he alue o ehicle impo s o Sou h A ica we e downloaded om he UN Com ade
da abase. The alue o a ious ehicle impo s pe yea we e downloaded. The e o e, he e will be
mo e han one alue pe yea . The da a a e in cu en US$.
View da a s uc u e
s (S owLand) # da a s uc u e
## 'da a. ame': 46 obs. o 47 a iables:
## $ TypeCode : ch "C" "C" "C" "C" ...
## $ F eqCode : ch "A" "A" "A" "A" ...
## $ Re Pe iodId : in 20220101 20220101 20210101 20210101 20200101 20200101
20190101 20190101 20180101 20180101 ...
## $ Re Yea : in 2022 2022 2021 2021 2020 2020 2019 2019 2018 2018 ...
## $ Re Mon h : in 52 52 52 52 52 52 52 52 52 52 ...
## $ Pe iod : in 2022 2022 2021 2021 2020 2020 2019 2019 2018 2018 ...
## $ Repo e Code : in 710 710 710 710 710 710 710 710 710 710 ...
## $ Repo e ISO : ch "ZAF" "ZAF" "ZAF" "ZAF" ...
## $ Repo e Desc : ch "Sou h A ica" "Sou h A ica" "Sou h A ica" "Sou h A ica" ...
## $ FlowCode : ch "M" "M" "M" "M" ...
## $ FlowDesc : ch "Impo " "Impo " "Impo " "Impo " ...
## $ Pa ne Code : in 0 0 0 0 0 0 0 0 0 0 ...
21
## $ Pa ne ISO : ch "W00" "W00" "W00" "W00" ...
## $ Pa ne Desc : ch "Wo ld" "Wo ld" "Wo ld" "Wo ld" ...
## $ Pa ne 2Code : in 0 0 0 0 0 0 0 0 0 0 ...
## $ Pa ne 2ISO : ch "W00" "W00" "W00" "W00" ...
## $ Pa ne 2Desc : ch "Wo ld" "Wo ld" "Wo ld" "Wo ld" ...
## $ Classi ica ionCode : ch "H6" "H6" "H5" "H5" ...
## $ Classi ica ionSea chCode: ch "HS" "HS" "HS" "HS" ...
## $ IsO iginalClassi ica ion: logi TRUE TRUE TRUE TRUE TRUE TRUE ...
## $ CmdCode : in 87 86 86 87 86 87 86 87 86 87 ...
## $ CmdDesc : ch "Vehicles; o he han ailway o amway olling s ock, and pa s and
accesso ies he eo " "Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o
amway ack ix u es and i ings a"| __ unca ed__ "Railway, amway locomo i es, olling-s ock
and pa s he eo ; ailway o amway ack ix u es and i ings a"| __ unca ed__ "Vehicles; o he
han ailway o amway olling s ock, and pa s and accesso ies he eo " ...
## $ Agg Le el : in 2 2 2 2 2 2 2 2 2 2 ...
## $ IsLea : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ Cus omsCode : ch "C00" "C00" "C00" "C00" ...
## $ Cus omsDesc : ch "TOTAL CPC" "TOTAL CPC" "TOTAL CPC" "TOTAL CPC" ...
## $ MosCode : in 0 0 0 0 0 0 0 0 0 0 ...
## $ Mo Code : in 0 0 0 0 0 0 0 0 0 0 ...
## $ Mo Desc : ch "TOTAL MOT" "TOTAL MOT" "TOTAL MOT" "TOTAL MOT" ...
## $ Q yUni Code : in -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
## $ Q yUni Abb : ch "N/A" "N/A" "N/A" "N/A" ...
## $ Q y : in 0 0 0 0 0 0 0 0 0 0 ...
## $ IsQ yEs ima ed : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ Al Q yUni Code : in -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
## $ Al Q yUni Abb : ch "N/A" "N/A" "N/A" "N/A" ...
## $ A lQ y : in 0 0 0 0 0 0 0 0 0 0 ...
## $ IsAl Q yEs ima ed : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ Ne Wg : in 0 0 0 0 0 0 0 0 0 0 ...
## $ IsNe Wg Es ima ed : logi TRUE FALSE FALSE TRUE TRUE TRUE ...
## $ G ossWg : in 0 0 0 0 0 0 0 0 0 0 ...
## $ IsG ossWg Es ima ed : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ Ci alue : num 0 0 0 0 0 0 0 0 0 0 ...
## $ Fob alue : num 8.33e+09 1.17e+08 1.26e+08 6.30e+09 9.45e+07 ...
## $ P ima yValue : num 8.33e+09 1.17e+08 1.26e+08 6.30e+09 9.45e+07 ...
## $ LegacyEs ima ionFlag : in 4 0 0 4 4 4 4 4 4 4 ...
## $ IsRepo ed : logi FALSE FALSE FALSE FALSE FALSE FALSE ...
## $ IsAgg ega e : logi TRUE TRUE TRUE TRUE TRUE TRUE ...
S anda disa ion
Con e da a in o 2017 USD using he con e sion ac o able.
# Me ge he da ase wi h he da ase con aining con e sion ac o s
S owLandS <- me ge(S owLand, CFDa ,by.x = c("Re Yea "), by.y = c("Yea ")) # me ge da ase s by yea
head (S owLandS) # heade o da a
## Re Yea TypeCode F eqCode Re Pe iodId Re Mon h Pe iod Repo e Code
## 1 2000 C A 20000101 52 2000 710
## 2 2000 C A 20000101 52 2000 710
## 3 2001 C A 20010101 52 2001 710

22
## 4 2001 C A 20010101 52 2001 710
## 5 2002 C A 20020101 52 2002 710
## 6 2002 C A 20020101 52 2002 710
## Repo e ISO Repo e Desc FlowCode FlowDesc Pa ne Code Pa ne ISO Pa ne Desc
## 1 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 2 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 3 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 4 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 5 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 6 ZAF Sou h A ica M Impo 0 W00 Wo ld
## Pa ne 2Code Pa ne 2ISO Pa ne 2Desc Classi ica ionCode
## 1 0 W00 Wo ld H1
## 2 0 W00 Wo ld H1
## 3 0 W00 Wo ld H1
## 4 0 W00 Wo ld H1
## 5 0 W00 Wo ld H2
## 6 0 W00 Wo ld H2
## Classi ica ionSea chCode IsO iginalClassi ica ion CmdCode
## 1 HS TRUE 86
## 2 HS TRUE 87
## 3 HS TRUE 86
## 4 HS TRUE 87
## 5 HS TRUE 86
## 6 HS TRUE 87
##
CmdDesc
## 1 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 2 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## 3 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 4 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## 5 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 6 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## Agg Le el IsLea Cus omsCode Cus omsDesc MosCode Mo Code Mo Desc
## 1 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 2 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 3 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 4 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 5 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 6 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## Q yUni Code Q yUni Abb Q y IsQ yEs ima ed Al Q yUni Code Al Q yUni Abb
## 1 -1 N/A NA FALSE -1 N/A
## 2 -1 N/A NA FALSE -1 N/A
23
## 3 -1 N/A NA FALSE -1 N/A
## 4 -1 N/A NA FALSE -1 N/A
## 5 -1 N/A NA FALSE -1 N/A
## 6 -1 N/A NA FALSE -1 N/A
## A lQ y IsAl Q yEs ima ed Ne Wg IsNe Wg Es ima ed G ossWg
## 1 NA FALSE NA FALSE NA
## 2 NA FALSE NA FALSE NA
## 3 NA FALSE NA FALSE NA
## 4 NA FALSE NA FALSE NA
## 5 NA FALSE NA FALSE NA
## 6 NA FALSE NA FALSE NA
## IsG ossWg Es ima ed Ci alue Fob alue P ima yValue LegacyEs ima ionFlag
## 1 FALSE 14925347 NA 14925347 0
## 2 FALSE 1515226062 NA 1515226062 0
## 3 FALSE 20026626 NA 20026626 0
## 4 FALSE 1610085158 NA 1610085158 0
## 5 FALSE 22063583 NA 22063583 0
## 6 FALSE 1792848346 NA 1792848346 0
## IsRepo ed IsAgg ega e Con e sion_ ac o
## 1 FALSE FALSE 0.703
## 2 FALSE FALSE 0.703
## 3 FALSE FALSE 0.723
## 4 FALSE FALSE 0.723
## 5 TRUE FALSE 0.734
## 6 TRUE FALSE 0.734
# Con e he da a by di iding he alue o each yea by he con e sion ac o o ha yea
S owLandS$Value_2017USD<-S owLandS$P ima yValue/S owLandS$Con e sion_ ac o # con e
alues
head (S owLandS) # heade o da a
## Re Yea TypeCode F eqCode Re Pe iodId Re Mon h Pe iod Repo e Code
## 1 2000 C A 20000101 52 2000 710
## 2 2000 C A 20000101 52 2000 710
## 3 2001 C A 20010101 52 2001 710
## 4 2001 C A 20010101 52 2001 710
## 5 2002 C A 20020101 52 2002 710
## 6 2002 C A 20020101 52 2002 710
## Repo e ISO Repo e Desc FlowCode FlowDesc Pa ne Code Pa ne ISO Pa ne Desc
## 1 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 2 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 3 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 4 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 5 ZAF Sou h A ica M Impo 0 W00 Wo ld
## 6 ZAF Sou h A ica M Impo 0 W00 Wo ld
## Pa ne 2Code Pa ne 2ISO Pa ne 2Desc Classi ica ionCode
## 1 0 W00 Wo ld H1
## 2 0 W00 Wo ld H1
## 3 0 W00 Wo ld H1
## 4 0 W00 Wo ld H1
## 5 0 W00 Wo ld H2
## 6 0 W00 Wo ld H2
24
## Classi ica ionSea chCode IsO iginalClassi ica ion CmdCode
## 1 HS TRUE 86
## 2 HS TRUE 87
## 3 HS TRUE 86
## 4 HS TRUE 87
## 5 HS TRUE 86
## 6 HS TRUE 87
##
CmdDesc
## 1 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 2 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## 3 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 4 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## 5 Railway, amway locomo i es, olling-s ock and pa s he eo ; ailway o amway ack
ix u es and i ings and pa s he eo ; mechanical (including elec o-mechanical) a ic signalling
equipmen o all kinds
## 6 Vehicles; o he han
ailway o amway olling s ock, and pa s and accesso ies he eo
## Agg Le el IsLea Cus omsCode Cus omsDesc MosCode Mo Code Mo Desc
## 1 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 2 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 3 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 4 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 5 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## 6 2 FALSE C00 TOTAL CPC 0 0 TOTAL MOT
## Q yUni Code Q yUni Abb Q y IsQ yEs ima ed Al Q yUni Code Al Q yUni Abb
## 1 -1 N/A NA FALSE -1 N/A
## 2 -1 N/A NA FALSE -1 N/A
## 3 -1 N/A NA FALSE -1 N/A
## 4 -1 N/A NA FALSE -1 N/A
## 5 -1 N/A NA FALSE -1 N/A
## 6 -1 N/A NA FALSE -1 N/A
## A lQ y IsAl Q yEs ima ed Ne Wg IsNe Wg Es ima ed G ossWg
## 1 NA FALSE NA FALSE NA
## 2 NA FALSE NA FALSE NA
## 3 NA FALSE NA FALSE NA
## 4 NA FALSE NA FALSE NA
## 5 NA FALSE NA FALSE NA
## 6 NA FALSE NA FALSE NA
## IsG ossWg Es ima ed Ci alue Fob alue P ima yValue LegacyEs ima ionFlag
## 1 FALSE 14925347 NA 14925347 0
## 2 FALSE 1515226062 NA 1515226062 0
## 3 FALSE 20026626 NA 20026626 0
## 4 FALSE 1610085158 NA 1610085158 0
## 5 FALSE 22063583 NA 22063583 0
25
## 6 FALSE 1792848346 NA 1792848346 0
## IsRepo ed IsAgg ega e Con e sion_ ac o Value_2017USD
## 1 FALSE FALSE 0.703 21230935
## 2 FALSE FALSE 0.703 2155371354
## 3 FALSE FALSE 0.723 27699344
## 4 FALSE FALSE 0.723 2226950426
## 5 TRUE FALSE 0.734 30059377
## 6 TRUE FALSE 0.734 2442572678
P e-p ocessing
Agg ega e da a.
Da a o a ious ehicle impo s pe yea ha e been downloaded. Calcula e he o al alue o
ehicle impo s pe yea .
S owLandPP <- agg ega e(S owLandS$Value_2017USD, by = lis (S owLandS$Re Yea ), FUN = sum)
colnames(S owLandPP)<-c("Yea ", "Value_2017USD") # se column names
head(S owLandPP) # heade o da a
## Yea Value_2017USD
## 1 2000 2176602289
## 2 2001 2254649770
## 3 2002 2472632056
## 4 2003 3443196812
## 5 2004 5226849958
## 6 2005 7156593620
Check o issues wi h ecen da a and make nessesa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owLandPP) # ail o da a
## Yea Value_2017USD
## 18 2017 7284778703
## 19 2018 7056557704
## 20 2019 6749647833
## 21 2020 4228938463
## 22 2021 5947713413
## 23 2022 7349015682
No adjus men s equi ed
P ocessing
Plo da a
Da a a e p esen ed as millions o US dolla s
windows(6,4)
pa (ma = c(4,5,1,1))
plo (S owLandPP$Yea , S owLandPP$Value_2017USD/1000000, pch = 18,
ylab = "Value o impo s n(millions o US dolla s)", xlab = "Yea ",
ylim = c(0, 11000))
32
Plo da a
Da a a e p esen ed as millions o US dolla s.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscCon Plan PP$Yea , EscCon Plan PP$Value_2017USD/1000000,
pch = 18, ylab = "Li e plan impo s n(millions o US dolla s)",
xlab = "Yea ", ylim = c(0, 25))
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde . See he wo k low pd o u he de ails.
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs (
"P ocessed_da a_p e ious_ epo Escape_Con aminan _plan s_COMTRADE_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscCon Plan PP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscCon Plan PP$Yea == Endp)
z<-which(EscCon Plan PP$Yea == Endn)
Pe cen ageChange<-((EscCon Plan PP$Value_2017USD[z]-
EscCon Plan PP$Value_2017USD[y])/EscCon Plan PP$Value_2017USD[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Value_2017USD[b] != EscCon Plan PP$Value_2017USD[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscCon Plan PP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Value_2017USD[b] != EscCon Plan PP$Value_2017USD[y]
}
Pa hway<-"escape/con aminan :plan sCom ade"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps

33
w i e.cs (EscCon Plan PP,
"P ocessed P ocessed_da a Escape_Con aminan _plan s_COMTRADE_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ", ow.names=F,
append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_Con aminan _plan s_COMTRADE. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscCon Plan PP$Yea , EscCon Plan PP$Value_2017USD/1000000,
pch = 18, ylab = "Li e plan impo s n(millions o US dolla s)",
xlab = "Yea ", ylim = c(0, 25))
g aphics.o ()
Escape: Fa med animals (FAO)
Da a on he numbe o animals p oduced in Sou h A ica we e downloaded om he FAOSTAT
da abase. These da a a e he numbe o a ious ypes o animals p oduced pe yea and, he e o e,
he e will be mo e han one alue pe yea . The uni s he da a a e eco ded in also di e (numbe ,
head o 1000 head).
View da a s uc u e
s (EscFa m) # da a s uc u e
## 'da a. ame': 732 obs. o 14 a iables:
## $ ï..Domain.Code : ch "QCL" "QCL" "QCL" "QCL" ...
## $ Domain : ch "C ops and li es ock p oduc s" "C ops and li es ock p oduc s" "C ops and
li es ock p oduc s" "C ops and li es ock p oduc s" ...
## $ A ea.Code..M49. : in 710 710 710 710 710 710 710 710 710 710 ...
## $ A ea : ch "Sou h A ica" "Sou h A ica" "Sou h A ica" "Sou h A ica" ...
## $ Elemen .Code : in 5111 5111 5111 5111 5111 5111 5111 5111 5111 5111 ...
## $ Elemen : ch "S ocks" "S ocks" "S ocks" "S ocks" ...
## $ I em.Code..CPC. : in 2132 2132 2132 2132 2132 2132 2132 2132 2132 2132 ...
## $ I em : ch "Asses" "Asses" "Asses" "Asses" ...
## $ Yea .Code : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Yea : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Uni : ch "Head" "Head" "Head" "Head" ...
## $ Value : in 345000 343000 340000 335000 330000 310000 280000 250000 230000
215000 ...
## $ Flag : ch "A" "E" "E" "E" ...
## $ Flag.Desc ip ion: ch "O icial igu e" "Es ima ed alue" "Es ima ed alue" "Es ima ed alue" ...
S anda disa ion
Con e he da a whe e equi ed so ha hey a e all in he same uni s
34
unique(EscFa m$Uni ) # uni s da a a e eco ded in
## [1] "Head" "No" "1000 Head"
EscFa mS<-EscFa m
mp<-which(EscFa mS$Uni == "1000 Head") # ows wi h da a in 1000 Head
EscFa mS$Value[ mp]<-EscFa mS$Value[ mp]*1000 # con e he alues o head
EscFa mS$Uni [ mp]<-"Head" # change uni
unique(EscFa mS$Uni ) # uni s o da a
## [1] "Head" "No"
P e-p ocessing
Remo e columns in da ase ha a e no equi ed. Only e ain columns wi h in o ma ion on he yea ,
he uni he da a we e eco ded in, and he alue.
EscFa mPP<-EscFa mS[,c("Yea ", "Uni ", "Value")]
head(EscFa mPP) # heade o da a
## Yea Uni Value
## 1 1961 Head 345000
## 2 1962 Head 343000
## 3 1963 Head 340000
## 4 1964 Head 335000
## 5 1965 Head 330000
## 6 1966 Head 310000
Agg ega e he da a
Da a o a ious a med animals pe yea ha e been downloaded. Calcula e he o al numbe o
animals p oduced pe yea
EscFa mPP<- agg ega e(EscFa mPP$Value, by = lis (EscFa mPP$Yea ), FUN = sum)
colnames(EscFa mPP)<-c("Yea ", "Numbe _animals") # se column names
head(EscFa mPP) # heade o da a
## Yea Numbe _animals
## 1 1961 76910008
## 2 1962 77616000
## 3 1963 78110000
## 4 1964 77299008
## 5 1965 78006000
## 6 1966 79790748
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscFa mPP) # ail o da a
## Yea Numbe _animals
## 56 2016 209324256
## 57 2017 211274152
## 58 2018 217160820
35
## 59 2019 213232190
## 60 2020 212577753
## 61 2021 212580950
No adjus men s equi ed
P ocessing
Plo da a
Da a a e p esen ed as millions o animals.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscFa mPP$Yea , EscFa mPP$Numbe _animals/1000000,
pch = 18, ylab = "Numbe o animals n(millions)",
xlab = "Yea ", ylim = c(0, 250))
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o you ile in he quo a ion ma ks in he code below (i.e. eplace he ile pa h in
he b acke s wi h ha o you ile). Inse double backslashes whe e equi ed
P e Da <-
ead.cs ("P ocessed_da a_p e ious_ epo Escape_ a med_animals_FAOSTAT_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscFa mPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscFa mPP$Yea == Endp)
z<-which(EscFa mPP$Yea == Endn)
Pe cen ageChange<-((EscFa mPP$Numbe _animals[z]-
EscFa mPP$Numbe _animals[y])/EscFa mPP$Numbe _animals[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe _animals[b] != EscFa mPP$Numbe _animals[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscFa mPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe _animals[b] != EscFa mPP$Numbe _animals[y]
}
Pa hway<-"escape: a mFAO"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
36
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscFa mPP,
"P ocessed P ocessed_da a Escape_ a med_animals_FAOSTAT_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_ a med_animals_FAOSTAT. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscFa mPP$Yea , EscFa mPP$Numbe _animals/1000000,
pch = 18, ylab = "Numbe o animals n(millions)",
xlab = "Yea ", ylim = c(0, 250))
g aphics.o ()
Con aminan : Con aminan on animals; Con aminan : Pa asi es on animals (FAO)
Da a on he numbe o animals impo ed o Sou h A ica we e downloaded om he FAOSTAT
da abase. These da a a e he numbe o a ious ypes o animals impo ed pe yea . The e o e,
he e will be mo e han one alue pe yea . The uni s he da a a e eco ded in also di e (numbe ,
head o 1000 head). The da ase also con ains missing da a.
View da a s uc u e
s (Con Ani) # da a s uc u e
## 'da a. ame': 501 obs. o 14 a iables:
## $ ï..Domain.Code : ch "TCL" "TCL" "TCL" "TCL" ...
## $ Domain : ch "C ops and li es ock p oduc s" "C ops and li es ock p oduc s" "C ops and
li es ock p oduc s" "C ops and li es ock p oduc s" ...
## $ A ea.Code..M49. : in 710 710 710 710 710 710 710 710 710 710 ...
## $ A ea : ch "Sou h A ica" "Sou h A ica" "Sou h A ica" "Sou h A ica" ...
## $ Elemen .Code : in 5608 5608 5608 5608 5608 5608 5608 5608 5608 5608 ...
## $ Elemen : ch "Impo Quan i y" "Impo Quan i y" "Impo Quan i y" "Impo Quan i y" ...
## $ I em.Code..CPC. : num 2132 2132 2132 2132 2132 ...
## $ I em : ch "Asses" "Asses" "Asses" "Asses" ...
## $ Yea .Code : in 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 ...
## $ Yea : in 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 ...
## $ Uni : ch "Head" "Head" "Head" "Head" ...
## $ Value : in 2 0 4 0 0 0 0 0 0 0 ...
## $ Flag : ch "A" "T" "A" "T" ...
## $ Flag.Desc ip ion: ch "O icial igu e" "Uno icial igu e" "O icial igu e" "Uno icial igu e" ...
37
S anda disa ion
Con e uni s. Con e he da a, whe e equi ed, so ha hey a e all in he same uni s.
unique(Con Ani$Uni ) # uni s da a a e eco ded in
## [1] "Head" "1000 Head"
Con AniS<-Con Ani
mp<-which(Con AniS$Uni == "1000 Head") # ows wi h da a in 1000 Head
Con AniS$Value[ mp]<-Con AniS$Value[ mp]*1000 # con e he alues
Con AniS$Uni [ mp]<-"Head" # change uni
unique(Con AniS$Uni ) # uni s o da a
## [1] "Head"
P e-p ocessing
Agg ega e he da a and emo e columns ha a e no equi ed.
Da a o a ious impo ed animals pe yea ha e been downloaded. Calcula e he o al numbe o
animals impo ed pe yea . Du ing his p ocess columns in da ase ha a e no equi ed a e
emo ed.
Con AniPP<- agg ega e(Con AniS$Value, by = lis (Con AniS$Yea ), FUN = sum)
colnames(Con AniPP)<-c("Yea ", "Numbe _animals") # se column names
head(Con AniPP) # heade o da a
## Yea Numbe _animals
## 1 1961 597605
## 2 1962 490834
## 3 1963 614001
## 4 1964 606405
## 5 1965 417766
## 6 1966 473615
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(Con AniPP) # ail o da a
## Yea Numbe _animals
## 56 2016 1174950
## 57 2017 1288017
## 58 2018 1406694
## 59 2019 1255753
## 60 2020 1033616
## 61 2021 1228880
No adjus men s equi ed
P ocessing
Plo da a

38
Da a a e p esen ed as millions o animals.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (Con AniPP$Yea , Con AniPP$Numbe _animals/1000000, pch = 18,
ylab = "Numbe o animals n(millions)",
xlab = "Yea ")
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <-
ead.cs ("P ocessed_da a_p e ious_ epo Con aminan _animals_FAOSTAT_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(Con AniPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(Con AniPP$Yea == Endp)
z<-which(Con AniPP$Yea == Endn)
Pe cen ageChange<-((Con AniPP$Numbe _animals[z]-
Con AniPP$Numbe _animals[y])/Con AniPP$Numbe _animals[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe _animals[b] != Con AniPP$Numbe _animals[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(Con AniPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe _animals[b] != Con AniPP$Numbe _animals[y]
}
Pa hway<-"con aminan :animalsFAO"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (Con AniPP,
"P ocessed P ocessed_da a Con aminan _animals_FAOSTAT_p ocessed.cs ",
ow.names = FALSE)
39
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Con aminan _animals_FAOSTAT. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (Con AniPP$Yea , Con AniPP$Numbe _animals/1000000, pch = 18,
ylab = "Numbe o animals n(millions)",
xlab = "Yea ")
g aphics.o ()
Escape: Fo es y (FAO)
Da a on he amoun o o es y p oduc s p oduced in Sou h A ica we e downloaded om he
FAOSTAT da abase. These da a a e he amoun o a ious ypes o o es y p oduc s p oduced pe
yea . The e o e, he e will be mo e han one alue pe yea . The uni s he da a a e eco ded in also
di e (݉
ଷ
and onnes).
View da a s uc u e
s (EscFo es ) # da a s uc u e
## 'da a. ame': 2049 obs. o 14 a iables:
## $ ï..Domain.Code : ch "FO" "FO" "FO" "FO" ...
## $ Domain : ch "Fo es y P oduc ion and T ade" "Fo es y P oduc ion and T ade" "Fo es y
P oduc ion and T ade" "Fo es y P oduc ion and T ade" ...
## $ A ea.Code..M49. : in 710 710 710 710 710 710 710 710 710 710 ...
## $ A ea : ch "Sou h A ica" "Sou h A ica" "Sou h A ica" "Sou h A ica" ...
## $ Elemen .Code : in 5516 5516 5516 5516 5516 5516 5516 5516 5516 5516 ...
## $ Elemen : ch "P oduc ion" "P oduc ion" "P oduc ion" "P oduc ion" ...
## $ I em.Code : in 1627 1627 1627 1627 1627 1627 1627 1627 1627 1627 ...
## $ I em : ch "Wood uel, coni e ous" "Wood uel, coni e ous" "Wood uel, coni e ous"
"Wood uel, coni e ous" ...
## $ Yea .Code : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Yea : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Uni : ch "m3" "m3" "m3" "m3" ...
## $ Value : in 62000 41000 43000 52000 70000 676000 678000 680000 682000 684000 ...
## $ Flag : ch "A" "A" "A" "A" ...
## $ Flag.Desc ip ion: ch "O icial igu e" "O icial igu e" "O icial igu e" "O icial igu e" ...
S anda disa ion
Remo e ows wi h da a eco ded in onnes. These da a include p oduc s such as wood palp and
pape e c. The e o e, only p oduc ion measu ed in ݉
ଷ
will be e ained, his includes p oduc s like
sawnwood, plywood, wood boa ds e c.
unique(EscFo es $Uni ) # uni s o da a
40
## [1] "m3" " onnes"
mp<-which(EscFo es $Uni == " onnes") # ows wi h da a in onnes
EscFo es S<-EscFo es [- mp,] # emo e ows wi h da a in onnes
P e-p ocessing
Agg ega e da a and emo e columns ha a e no equi ed.
Da a o a ious o es y p oduc s pe yea ha e been downloaded. Calcula e he o al o es y
p oduc ion pe yea . Du ing his p ocess only equi ed columns a e e ained.
EscFo es PP<- agg ega e(EscFo es S$Value, by = lis (EscFo es S$Yea ), FUN = sum)
colnames(EscFo es PP)<-c("Yea ", "P oduc ion_m3") # se column names
head(EscFo es PP) # heade o da a
## Yea P oduc ion_m3
## 1 1961 6228900
## 2 1962 6809600
## 3 1963 7396200
## 4 1964 7668100
## 5 1965 9488000
## 6 1966 15783816
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscFo es PP) # ail o da a
## Yea P oduc ion_m3
## 56 2016 32410479
## 57 2017 31122288
## 58 2018 34039529
## 59 2019 34525442
## 60 2020 34633178
## 61 2021 34983178
No adjus men s equi ed
P ocessing
Plo da a
Da a a e p esen ed as p oduc ion in millions ݉
ଷ
.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscFo es PP$Yea , EscFo es PP$P oduc ion_m3/1000000, pch = 18,
ylab = exp ession(Fo es y ~ p oduc ion ~ (million ~ m^{3})),
xlab = "Yea ", ylim = c(0,55))
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
41
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Escape_ o es y_FAOSTAT_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscFo es PP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscFo es PP$Yea == Endp)
z<-which(EscFo es PP$Yea == Endn)
Pe cen ageChange<-((EscFo es PP$P oduc ion_m3[z]-
EscFo es PP$P oduc ion_m3[y])/EscFo es PP$P oduc ion_m3[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $P oduc ion_m3[b] != EscFo es PP$P oduc ion_m3[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscFo es PP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $P oduc ion_m3[b] != EscFo es PP$P oduc ion_m3[y]
}
Pa hway<-"escape: o es yFAO"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscFo es PP,
"P ocessed P ocessed_da a Escape_ o es y_FAOSTAT_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_ o es y_FAOSTAT. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscFo es PP$Yea , EscFo es PP$P oduc ion_m3/1000000, pch = 18,
ylab = exp ession(Fo es y ~ p oduc ion ~ (million ~ m^{3})),
48
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(Con FoodPP$Yea == Endp)
z<-which(Con FoodPP$Yea == Endn)
Pe cen ageChange<-((Con FoodPP$Tonnes[z]-
Con FoodPP$Tonnes[y])/Con FoodPP$Tonnes[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Tonnes[b] != Con FoodPP$Tonnes[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(Con FoodPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Tonnes[b] != Con FoodPP$Tonnes[y]
}
Pa hway<-"con aminan : oodFAO"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (Con FoodPP,
"P ocessed P ocessed_da a Con aminan _ ood_FAOSTAT_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Con aminan _ ood_FAOSTAT. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (Con FoodPP$Yea , Con FoodPP$Tonnes/1000000, pch = 18,
ylab = "Quan i y o impo ed ood n(million onnes)",
xlab = "Yea ", ylim = c(0, 11))
g aphics.o ()
Escape: Ag icul u e (FAO)
Da a on he quan i y o c ops p oduced and a ea ha es ed in Sou h A ica we e downloaded om
he FAOSTAT da abase. These da a a e he amoun p oduced and a ea ha es ed o a ious ypes o
c ops pe yea . The e o e, he e will be mo e han one alue pe yea , o bo h p oduc ion and a ea

49
ha es ed. Da a o a ea ha es ed a e in ha, and da a o p oduc ion a e in onnes. The da ase
con ains missing da a.
View da a s uc u e
s (EscAg i) # da a s uc u e
## 'da a. ame': 8481 obs. o 14 a iables:
## $ ï..Domain.Code : ch "QCL" "QCL" "QCL" "QCL" ...
## $ Domain : ch "C ops and li es ock p oduc s" "C ops and li es ock p oduc s" "C ops and
li es ock p oduc s" "C ops and li es ock p oduc s" ...
## $ A ea.Code..M49. : in 710 710 710 710 710 710 710 710 710 710 ...
## $ A ea : ch "Sou h A ica" "Sou h A ica" "Sou h A ica" "Sou h A ica" ...
## $ Elemen .Code : in 5312 5312 5312 5312 5312 5312 5312 5312 5312 5312 ...
## $ Elemen : ch "A ea ha es ed" "A ea ha es ed" "A ea ha es ed" "A ea ha es ed" ...
## $ I em.Code..CPC. : num 1341 1341 1341 1341 1341 ...
## $ I em : ch "Apples" "Apples" "Apples" "Apples" ...
## $ Yea .Code : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Yea : in 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 ...
## $ Uni : ch "ha" "ha" "ha" "ha" ...
## $ Value : num 7000 8000 8000 10000 10000 12000 12000 15000 15000 15000 ...
## $ Flag : ch "E" "E" "E" "E" ...
## $ Flag.Desc ip ion: ch "Es ima ed alue" "Es ima ed alue" "Es ima ed alue" "Es ima ed alue"
...
S anda disa ion
Da a do no need o be s anda dised
P e-p ocessing
Remo e columns in da ase ha a e no equi ed. Only e ain columns wi h in o ma ion on he yea ,
he ype o da a (p oduc ion o a ea ha es ed), he uni s he da a we e eco ded in, and he alue.
EscAg iPP<-EscAg i[,c("Elemen ","Yea ", "Uni ", "Value")]
head(EscAg iPP) # heade o da a
## Elemen Yea Uni Value
## 1 A ea ha es ed 1961 ha 7000
## 2 A ea ha es ed 1962 ha 8000
## 3 A ea ha es ed 1963 ha 8000
## 4 A ea ha es ed 1964 ha 10000
## 5 A ea ha es ed 1965 ha 10000
## 6 A ea ha es ed 1966 ha 12000
Sepa a e in o wo da ase s, one o a ea ha es ed, and one o p oduc ion
unique(EscAg iPP$Elemen )
## [1] "A ea ha es ed" "P oduc ion"
EscAg iP od<-EscAg iPP[EscAg iPP$Elemen == "P oduc ion",] # p oduc ion da ase
EscAg iA ea<-EscAg iPP[EscAg iPP$Elemen == "A ea ha es ed",] # a ea ha es ed da ase
Agg ega e da a.
50
Da a o a ious c ops pe yea ha e been downloaded. Calcula e he o al c ops p oduced o a ea
ha es ed pe yea
EscAg iP od<- agg ega e(EscAg iP od$Value, by = lis (EscAg iP od$Yea ), FUN = sum)
colnames(EscAg iP od)<-c("Yea ", "Tonnes") # se column names
head(EscAg iP od) # heade o da a o p oduc ion
## Yea Tonnes
## 1 1961 18633862
## 2 1962 20199198
## 3 1963 21115101
## 4 1964 20291592
## 5 1965 18199915
## 6 1966 24290547
EscAg iA ea<- agg ega e(EscAg iA ea$Value, by = lis (EscAg iA ea$Yea ), FUN = sum)
colnames(EscAg iA ea)<-c("Yea ", "ha") # se column names
head(EscAg iA ea) # heade o da a o a ea ha es ed
## Yea ha
## 1 1961 7257879
## 2 1962 7406680
## 3 1963 7973507
## 4 1964 7671384
## 5 1965 7710539
## 6 1966 7461358
C ea e one da ase
EscAg iPP <- me ge(EscAg iA ea,EscAg iP od,by="Yea ") # me ge da ase s by yea
head (EscAg iPP) # heade o da a
## Yea ha Tonnes
## 1 1961 7257879 18633862
## 2 1962 7406680 20199198
## 3 1963 7973507 21115101
## 4 1964 7671384 20291592
## 5 1965 7710539 18199915
## 6 1966 7461358 24290547
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscAg iPP) # ail o da a
## Yea ha Tonnes
## 56 2016 5124186 38863809
## 57 2017 5951579 51745855
## 58 2018 5854130 50201568
## 59 2019 5746296 48173091
## 60 2020 5997125 52471104
## 61 2021 6324036 54211340
51
No adjus men s equi ed
P ocessing
Plo da a
Da a a e p esen ed as millions onnes, and millions o ha.
windows(6,4)
pa (ma = c(4,5,1,5)+ 0.3)
plo (EscAg iPP$Yea , EscAg iPP$ha/1000000,
pch = 18, ylab = "A ea ha es ed (million ha)", xlab = "Yea ",
ylim = c(0, 10)) # C ea e i s plo .
pa (new = TRUE)
plo (EscAg iPP$Yea , EscAg iPP$Tonnes/1000000, pch = 15,
col = "g ay", axes = FALSE, xlab = "", ylab = "",
ylim = c(0, 55)) # C ea e second plo wi hou axes
axis(side = 4, a = p e y( ange(EscAg iPP$Tonnes/1000000))) # Add second axis
axis(side = 4, a = seq(0, 15, by = 5), labels = c("", "5", "10", "15"))# Add labels
m ex ("P oduc ion (million onnes)", side = 4, line = 3) # Add second axes label
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Escape_ag icul u e_FAOSTAT_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscAg iPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscAg iPP$Yea == Endp)
z<-which(EscAg iPP$Yea == Endn)
Pe cen ageChange<-((EscAg iPP$Tonnes[z]-EscAg iPP$Tonnes[y])/EscAg iPP$Tonnes[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Tonnes[b] != EscAg iPP$Tonnes[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscAg iPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Tonnes[b] != EscAg iPP$Tonnes[y]
}
52
Pa hway<-"escape:ag icul u eP oduc ionFAO"
esul s1<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Endp<-max(P e Da $Yea )
Endn<-max(EscAg iPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscAg iPP$Yea == Endp)
z<-which(EscAg iPP$Yea == Endn)
Pe cen ageChange<-((EscAg iPP$ha[z]-EscAg iPP$ha[y])/EscAg iPP$ha[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $ha[b] != EscAg iPP$ha[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscAg iPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $ha[b] != EscAg iPP$ha[y]
}
Pa hway<-"escape:ag iul u eA eaFAO"
esul s2<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscAg iPP,
"P ocessed P ocessed_da a Escape_ag icul u e_FAOSTAT_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s1,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
w i e. able( esul s2,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_ag icul u e_FAOSTAT. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,5)+ 0.3)
plo (EscAg iPP$Yea , EscAg iPP$ha/1000000,
pch = 18, ylab = "A ea ha es ed (million ha)", xlab = "Yea ",
ylim = c(0, 10)) # C ea e i s plo .
pa (new = TRUE)
plo (EscAg iPP$Yea , EscAg iPP$Tonnes/1000000, pch = 15,
53
col = "g ay", axes = FALSE, xlab = "", ylab = "",
ylim = c(0, 55)) # C ea e second plo wi hou axes
axis(side = 4, a = p e y( ange(EscAg iPP$Tonnes/1000000))) # Add second axis
axis(side = 4, a = seq(0, 15, by = 5), labels = c("", "5", "10", "15"))# Add labels
m ex ("P oduc ion (million onnes)", side = 4, line = 3) # Add second axes label
g aphics.o ()
S owaway: Con aine /bulk (T ansne )
Da a on he numbe o deepsea con aine s landed in Sou h A ica yea ly we e ob ained om
T ansne Na ional Po s Au ho i y. The o iginal da a we e downloaded as a pd , bu we e manually
ex ac ed and inpu ed in o a cs in p e ious s eps o his wo k low.
View da a s uc u e
s (S owCa go) # da a s uc u e
## 'da a. ame': 13 obs. o 2 a iables:
## $ Yea : in 2009 2010 2011 2012 2014 2015 2016 2017 2018 2019 ...
## $ To al_ eus: in 1618378 1510837 1619738 1686291 1728135 1769498 1670693 NA 1872412
2319445 ...
S anda disa ion
These da a do no need o be s anda dised
P e-p ocessing
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owCa go) # ail o da a
## Yea To al_ eus
## 8 2017 NA
## 9 2018 1872412
## 10 2019 2319445
## 11 2020 1605458
## 12 2021 1790298
## 13 2022 1774171
No adjus men s equi ed
P ocessing
Plo da a
Da a a e p esen ed as millions o eus.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (S owCa go$Yea , S owCa go$To al_ eus/1000000, pch = 18,
ylab = "Numbe o deepsea con aine s landed n(million eus)",
xlab = "Yea ", ylim = c(0,2.5))

54
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o you ile in he quo a ion ma ks in he code below (i.e. eplace he ile pa h in
he b acke s wi h ha o you ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo S owaway_ca go_TRANSNET_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(S owCa go$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(S owCa go$Yea == Endp)
z<-which(S owCa go$Yea == Endn)
Pe cen ageChange<-((S owCa go$To al_ eus[z]-
S owCa go$To al_ eus[y])/S owCa go$To al_ eus[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $To al_ eus[b] != S owCa go$To al_ eus[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(S owCa go$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $To al_ eus[b] != S owCa go$To al_ eus[y]
}
Pa hway<-"s owaway:ca goT ansne "
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (S owCa go,
"P ocessed P ocessed_da a S owaway_ca go_TRANSNET_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s S owaway_ca go_TRANSNET. i ",
wid h = 6, heigh = 4, uni s = "in",
55
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (S owCa go$Yea , S owCa go$To al_ eus/1000000, pch = 18,
ylab = "Numbe o deepsea con aine s landed n(million eus)",
xlab = "Yea ", ylim = c(0,2.5))
g aphics.o ()
S owaway: Ship/boa hull ouling; S owaway: Ship/boa ballas wa e ; S owaway: Hi chhike s on
ship/boa (T ansne )
Da a on he o al numbe o ocean going essels a i ing in Sou h A ica yea ly we e downloaded
om T ansne Na ional Po s Au ho i y. The o iginal da a we e downloaded as a pd , bu we e
ex ac ed and inpu ed in o a cs du ing manual p ocesseing in p e ious s eps o his wo k low.
View da a s uc u e
s (S owShip) # da a s uc u e
## 'da a. ame': 19 obs. o 2 a iables:
## $ Yea : in 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 ...
## $ To al_a i als: in 9405 8833 8929 9200 9099 9331 9251 NA NA NA ...
S anda disa ion
Da a does no need o be s anda dised
P e-p ocessing
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owShip) # ail o da a
## Yea To al_a i als
## 14 2017 NA
## 15 2018 7622
## 16 2019 8041
## 17 2020 7654
## 18 2021 7094
## 19 2022 7096
No adjus men s equi ed
P ocessing
Plo da a
windows(6,4)
pa (ma = c(4,5,1,1))
plo (S owShip$Yea , S owShip$To al_a i als, pch = 18,
ylab = "Numbe o ocean going essel a i als", xlab = "Yea ",
ylim = c(0, 10000))
Pe o m calcula ions
56
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o you ile in he quo a ion ma ks in he code below (i.e. eplace he ile pa h in
he b acke s wi h ha o you ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo S owaway_ship_TRANSNET_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(S owShip$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(S owShip$Yea == Endp)
z<-which(S owShip$Yea == Endn)
Pe cen ageChange<-((S owShip$To al_a i als[z]-
S owShip$To al_a i als[y])/S owShip$To al_a i als[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $To al_a i als[b] != S owShip$To al_a i als[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(S owShip$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $To al_a i als[b] != S owShip$To al_a i als[y]
}
Pa hway<-"s owaway:shipT ansne "
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (S owShip,
"P ocessed P ocessed_da a S owaway_ship_TRANSNET_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s S owaway_ship_TRANSNET. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
57
pa (ma = c(4,5,1,1))
plo (S owShip$Yea , S owShip$To al_a i als, pch = 18,
ylab = "Numbe o ocean going essel a i als", xlab = "Yea ",
ylim = c(0, 10000))
g aphics.o ()
S owaway: Angling/ ishing equipmen (T ansne )
Da a on he o al numbe o o eign and Sou h A ican awle s in Sou h A ica yea ly we e ob ained
om T ansne Na ional Po s Au ho i y. The o iginal da a we e downloaded as a pd , bu we e
manually p ocessed in p e ious s eps o his wo k low.
View da a s uc u e
s (S owFishVes) # da a s uc u e
## 'da a. ame': 18 obs. o 3 a iables:
## $ Yea : in 2014 2015 2016 2017 2018 2019 2020 2021 2022 2014 ...
## $ T awle : ch "Sou h_A ican" "Sou h_A ican" "Sou h_A ican" "Sou h_A ican" ...
## $ Numbe : in 1186 1033 879 NA 468 521 385 542 NA 533 ...
S anda disa ion
Da a does no need o be s anda dised
P e-p ocessing
Agg ega e da a.
Calcula e he o al numbe o ishing essels pe yea .
S owFishVesPP<- agg ega e(S owFishVes$Numbe , by = lis (S owFishVes$Yea ), FUN = sum)
colnames(S owFishVesPP)<-c("Yea ", "Numbe ") # se column names
head(S owFishVesPP) # heade o da a o a ea ha es ed
## Yea Numbe
## 1 2014 1719
## 2 2015 1518
## 3 2016 1245
## 4 2017 NA
## 5 2018 757
## 6 2019 891
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owFishVesPP) # ail o da a
## Yea Numbe
## 4 2017 NA
## 5 2018 757
## 6 2019 891
## 7 2020 682
64
mp<-which(EscResPP$Yea > 2020)
EscResPP<-EscResPP[- mp,]
P ocessing
Plo da a
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscResPP$Yea , EscResPP$Numbe , pch = 18,
ylab = "Numbe o o ganisms", xlab = "Yea ")
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Escape_ esea ch_CITES_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo ha e changed, and i
new da a a e a ailable calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscResPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscResPP$Yea == Endp)
z<-which(EscResPP$Yea == Endn)
Pe cen ageChange<-((EscResPP$Numbe [z]-EscResPP$Numbe [y])/EscResPP$Numbe [y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscResPP$Numbe [y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscResPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscResPP$Numbe [y]
}
Pa hway<-"escape: esea chCITES"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscResPP,
"P ocessed P ocessed_da a Escape_ esea ch_CITES_p ocessed.cs ",
ow.names = FALSE)

65
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_ esea ch_CITES. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscResPP$Yea , EscResPP$Numbe , pch = 18,
ylab = "Numbe o o ganisms", xlab = "Yea ")
g aphics.o ()
Escape: Pe
Da a on animals impo ed o pe sonal o comme cial pu poses pe yea we e downloaded om
CITES. The e o e, he e will be mo e han one alue pe yea . Da a a e in sho o m. In a ew
ins ances uni s a e g ams/kilog ams o o he uni s.
View da a s uc u e
s (EscPe ) # da a s uc u e
## 'da a. ame': 5155 obs. o 53 a iables:
## $ App. : ch "I" "I" "I" "I" ...
## $ Taxon : ch "Acinonyx juba us" "Addax nasomacula us" "Ae angis ellisii" "Aloe bella ula" ...
## $ Te m : ch "li e" "li e" "li e" "li e" ...
## $ Uni : ch "" "" "" "" ...
## $ Coun y: ch "ZA" "ZA" "ZA" "ZA" ...
## $ X1975 : logi NA NA NA NA NA NA ...
## $ X1976 : logi NA NA NA NA NA NA ...
## $ X1977 : logi NA NA NA NA NA NA ...
## $ X1978 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1979 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1980 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1981 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1982 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1983 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1984 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1985 : in 11 NA NA NA NA NA NA NA NA NA ...
## $ X1986 : in 15 NA NA NA NA NA NA NA NA NA ...
## $ X1987 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1988 : in 23 NA NA NA NA NA NA NA NA NA ...
## $ X1989 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1990 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1991 : in 2 NA NA NA NA NA NA NA NA NA ...
## $ X1992 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1993 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1994 : in 4 NA NA NA NA NA NA NA NA NA ...
## $ X1995 : num 26 NA NA 2 NA 2 4 2 2 NA ...
66
## $ X1996 : in 1 NA NA NA NA NA NA NA NA NA ...
## $ X1997 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1998 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1999 : in 4 25 NA NA NA NA NA NA NA NA ...
## $ X2000 : in 1 NA NA NA NA NA NA NA NA NA ...
## $ X2001 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2002 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2003 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2004 : in 2 NA NA NA NA NA NA NA NA NA ...
## $ X2005 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2006 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2007 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2008 : num 2 NA NA NA NA NA NA NA NA NA ...
## $ X2009 : in NA NA NA NA NA 4 5 4 NA NA ...
## $ X2010 : in NA NA NA NA 8 NA NA NA NA NA ...
## $ X2011 : in NA 5 NA NA 6 NA NA NA NA 5 ...
## $ X2012 : num NA NA NA NA NA NA NA NA NA NA ...
## $ X2013 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2014 : in 1 NA NA NA NA NA NA NA NA NA ...
## $ X2015 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2016 : in NA NA 2 NA NA NA NA NA NA NA ...
## $ X2017 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2018 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2019 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2020 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2021 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2022 : logi NA NA NA NA NA NA ...
S anda disa ion
Remo e da a collec ed in g ams/kg o o he uni s
unique(EscPe $Uni ) # uni s da a we e eco ded in
## [1] "" "Numbe o specimens" "kg"
## [4] " lasks" "g" "se s"
mp<-which(EscPe $Uni == "g") # which ows con ain da a in g
mp2<-which(EscPe $Uni == "kg") # which ows con ain da a in kg
mp3<-which(EscPe $Uni == "se s") # which ows con ain da a in se s
mp4<-which(EscPe $Uni == " lasks") # which ows con ain da a in lasks
EscPe PP<-EscPe [-c( mp, mp2, mp3, mp4),] # emo e ows
P e-p ocessing
Agg ega e da a. Calcula e he o al numbe o o ganisms o each yea
names(EscPe PP) # column names
## [1] "App." "Taxon" "Te m" "Uni " "Coun y" "X1975" "X1976"
## [8] "X1977" "X1978" "X1979" "X1980" "X1981" "X1982" "X1983"
## [15] "X1984" "X1985" "X1986" "X1987" "X1988" "X1989" "X1990"
## [22] "X1991" "X1992" "X1993" "X1994" "X1995" "X1996" "X1997"
67
## [29] "X1998" "X1999" "X2000" "X2001" "X2002" "X2003" "X2004"
## [36] "X2005" "X2006" "X2007" "X2008" "X2009" "X2010" "X2011"
## [43] "X2012" "X2013" "X2014" "X2015" "X2016" "X2017" "X2018"
## [50] "X2019" "X2020" "X2021" "X2022"
EscPe PP<-EscPe PP[,c(6:ncol(EscPe PP))] # es ic da a o columns wi h coun s
EscPe PP<-colSums(EscPe PP, na. m = TRUE) # calcula e he o al pe yea
C ea e a long o m da ase
Yea <-s spli (names(EscPe PP), "X") # emo e 'X' om he yea s
Yea <-unlis (Yea ) # c ea e ec o wi h he yea s
mp3<-which(Yea == "") # iden i y missing alues
Yea <-Yea [- mp3] # emo e missing alues
EscPe PP<-as.da a. ame(EscPe PP)
EscPe PP<-cbind(Yea , EscPe PP) # bind he coun s o he yea s
ow.names(EscPe PP)<-NULL
colnames(EscPe PP)[2]<-"Numbe " # column name
head(EscPe PP) # heade o da a
## Yea Numbe
## 1 1975 0
## 2 1976 0
## 3 1977 0
## 4 1978 2
## 5 1979 332
## 6 1980 2105
EscPe PP$Yea <-as.nume ic(EscPe PP$Yea )
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscPe PP) # ail o da a
## Yea Numbe
## 43 2017 141809
## 44 2018 68540
## 45 2019 95411
## 46 2020 190310
## 47 2021 105689
## 48 2022 0
Remo e he wo mos ecen yea s as da a does no appea o be comple e
mp<-which(EscPe PP$Yea > 2020)
EscPe PP<-EscPe PP[- mp,]
P ocessing
Plo da a
Da a a e p esen ed as housands o animals
68
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscPe PP$Yea , EscPe PP$Numbe /1000, pch = 18,
ylab = "Numbe o o ganisms n( housands)",
xlab = "Yea ")
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o you ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Escape_pe _CITES_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscPe PP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscPe PP$Yea == Endp)
z<-which(EscPe PP$Yea == Endn)
Pe cen ageChange<-((EscPe PP$Numbe [z]-EscPe PP$Numbe [y])/EscPe PP$Numbe [y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscPe PP$Numbe [y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscPe PP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscPe PP$Numbe [y]
}
Pa hway<-"escape:pe CITES"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscPe PP,
"P ocessed P ocessed_da a Escape_pe _CITES_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
69
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_pe _CITES. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscPe PP$Yea , EscPe PP$Numbe /1000, pch = 18,
ylab = "Numbe o o ganisms n( housands)",
xlab = "Yea ")
g aphics.o ()
Escape: Bo anical ga den and zoo (CITES)
Da a on he amoun o li e animals impo ed pe yea o bo anical ga den o zoo pu poses we e
downloaded om CITES. The e o e, he e will be mo e han one alue pe yea . Da a a e in sho
o m.
View da a s uc u e
s (EscBo Zoo) # da a s uc u e
## 'da a. ame': 428 obs. o 53 a iables:
## $ App. : ch "I" "I" "I" "I" ...
## $ Taxon : ch "Acinonyx juba us" "Ac an ophis dume ili" "Addax nasomacula us" "Ailu us
ulgens" ...
## $ Te m : ch "li e" "li e" "li e" "li e" ...
## $ Uni : ch "" "" "" "" ...
## $ Coun y: ch "ZA" "ZA" "ZA" "ZA" ...
## $ X1975 : logi NA NA NA NA NA NA ...
## $ X1976 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1977 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1978 : logi NA NA NA NA NA NA ...
## $ X1979 : logi NA NA NA NA NA NA ...
## $ X1980 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1981 : in NA 2 NA NA NA NA NA NA NA NA ...
## $ X1982 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1983 : in 2 NA NA NA NA NA NA NA NA NA ...
## $ X1984 : in 11 NA NA NA NA NA NA NA NA NA ...
## $ X1985 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1986 : in 3 NA NA NA NA NA NA NA NA NA ...
## $ X1987 : in 11 NA NA NA NA NA NA NA NA NA ...
## $ X1988 : in 10 1 NA NA NA NA NA NA NA NA ...
## $ X1989 : in 27 NA NA NA 4 NA NA NA NA NA ...
## $ X1990 : in 9 NA NA NA NA 6 NA NA NA NA ...
## $ X1991 : in 11 NA NA NA NA NA 2 NA NA 2 ...
## $ X1992 : in 7 NA NA NA NA 9 NA 4 1 NA ...
## $ X1993 : in 4 NA NA NA NA NA NA NA NA NA ...
## $ X1994 : in 8 NA NA NA NA NA NA 2 NA NA ...
## $ X1995 : in 43 NA NA NA NA NA NA NA NA NA ...

70
## $ X1996 : in 1 NA NA 2 NA NA NA NA NA NA ...
## $ X1997 : in 6 NA NA NA NA NA NA NA NA NA ...
## $ X1998 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X1999 : in 2 NA NA NA NA NA NA NA NA NA ...
## $ X2000 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2001 : in 1 NA NA NA NA NA NA NA NA NA ...
## $ X2002 : in NA NA NA NA NA NA 1 NA NA NA ...
## $ X2003 : in NA NA NA NA NA NA 1 NA NA NA ...
## $ X2004 : in NA NA NA NA NA NA NA NA 46 NA ...
## $ X2005 : in NA NA NA NA NA 6 NA NA NA NA ...
## $ X2006 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2007 : in NA NA 1 NA NA NA NA NA NA NA ...
## $ X2008 : in 2 NA 1 NA NA NA NA NA NA NA ...
## $ X2009 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2010 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2011 : in NA NA NA NA NA NA 15 NA NA NA ...
## $ X2012 : in NA NA NA NA NA NA 5 NA NA NA ...
## $ X2013 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2014 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2015 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2016 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2017 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2018 : in NA NA NA NA NA 4 NA NA NA NA ...
## $ X2019 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2020 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2021 : in NA NA NA NA NA NA NA NA NA NA ...
## $ X2022 : logi NA NA NA NA NA NA ...
S anda disa ion
The da a do no need o be s anda dised
P e-p ocessing
Agg ega e da a. Calcula e he o al numbe o o ganisms o each yea
names(EscBo Zoo) # column names
## [1] "App." "Taxon" "Te m" "Uni " "Coun y" "X1975" "X1976"
## [8] "X1977" "X1978" "X1979" "X1980" "X1981" "X1982" "X1983"
## [15] "X1984" "X1985" "X1986" "X1987" "X1988" "X1989" "X1990"
## [22] "X1991" "X1992" "X1993" "X1994" "X1995" "X1996" "X1997"
## [29] "X1998" "X1999" "X2000" "X2001" "X2002" "X2003" "X2004"
## [36] "X2005" "X2006" "X2007" "X2008" "X2009" "X2010" "X2011"
## [43] "X2012" "X2013" "X2014" "X2015" "X2016" "X2017" "X2018"
## [50] "X2019" "X2020" "X2021" "X2022"
EscBo ZooPP<-EscBo Zoo[,c(6:ncol(EscBo Zoo))] # es ic da a o columns wi h coun s
EscBo ZooPP<-colSums(EscBo ZooPP, na. m = TRUE) # calcula e he o al pe yea
C ea e a long o m da ase
Yea <-s spli (names(EscBo ZooPP), "X") # emo e 'X' om he yea s
Yea <-unlis (Yea ) # c ea e ec o wi h he yea s
71
mp3<-which(Yea == "") # iden i y missing alues
Yea <-Yea [- mp3] # emo e missing alues
EscBo ZooPP<-as.da a. ame(EscBo ZooPP)
EscBo ZooPP<-cbind(Yea , EscBo ZooPP) # bind he coun s o he yea s
ow.names(EscBo ZooPP)<-NULL
colnames(EscBo ZooPP)[2]<-"Numbe " # column name
head(EscBo ZooPP) # heade o da a
## Yea Numbe
## 1 1975 0
## 2 1976 8
## 3 1977 1
## 4 1978 0
## 5 1979 0
## 6 1980 7
EscBo ZooPP$Yea <-as.nume ic(EscBo ZooPP$Yea )
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscBo ZooPP) # ail o da a
## Yea Numbe
## 43 2017 71
## 44 2018 31
## 45 2019 79
## 46 2020 30
## 47 2021 151
## 48 2022 0
Remo e he wo mos ecen yea s as da a a e incomple e o hese yea s
mp<-which(EscBo ZooPP$Yea > 2020)
EscBo ZooPP<-EscBo ZooPP[- mp,]
P ocessing
Plo da a
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscBo ZooPP$Yea , EscBo ZooPP$Numbe , pch = 18,
ylab = "Numbe o o ganisms", xlab = "Yea ")
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
72
P e Da <-
ead.cs ("P ocessed_da a_p e ious_ epo Escape_bo ga den_zoo_CITES_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscBo ZooPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscBo ZooPP$Yea == Endp)
z<-which(EscBo ZooPP$Yea == Endn)
Pe cen ageChange<-((EscBo ZooPP$Numbe [z]-
EscBo ZooPP$Numbe [y])/EscBo ZooPP$Numbe [y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscBo ZooPP$Numbe [y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscBo ZooPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != EscBo ZooPP$Numbe [y]
}
Pa hway<-"escape:bo zooCITES"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscBo ZooPP,
"P ocessed P ocessed_da a Escape_bo ga den_zoo_CITES_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_bo ga den_zoo_CITES. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscBo ZooPP$Yea , EscBo ZooPP$Numbe , pch = 18,
ylab = "Numbe o o ganisms", xlab = "Yea ")
g aphics.o ()
73
Unaided (WTO)
Da a on he yea ly alue o me chandise impo s o each con inen al A ican coun y, excep Sou h
A ica, we e downloaded om he Wo ld T ade O ganisa ion. The e o e, he e will be mo e han
one alue pe yea . Da a a e million US$. No indica ion in he me ada a ha hese da a ha e been
adjus ed o in la ion.
View da a s uc u e
s (UnaidedWTO) # da a s uc u e
## 'da a. ame': 3273 obs. o 24 a iables:
## $ Indica o .Ca ego y : ch "Me chandise ade alues" "Me chandise ade alues"
"Me chandise ade alues" "Me chandise ade alues" ...
## $ Indica o .Code : ch "ITS_MTV_AM" "ITS_MTV_AM" "ITS_MTV_AM" "ITS_MTV_AM"
...
## $ Indica o : ch "Me chandise impo s by p oduc g oup – annual" "Me chandise
impo s by p oduc g oup – annual" "Me chandise impo s by p oduc g oup – annual" "Me chandise
impo s by p oduc g oup – annual" ...
## $ Repo ing.Economy.Code : in 12 12 12 12 12 12 12 12 12 12 ...
## $ Repo ing.Economy.ISO3A.Code : ch "DZA" "DZA" "DZA" "DZA" ...
## $ Repo ing.Economy : ch "Alge ia" "Alge ia" "Alge ia" "Alge ia" ...
## $ Pa ne .Economy.Code : in 0 0 0 0 0 0 0 0 0 0 ...
## $ Pa ne .Economy.ISO3A.Code : logi NA NA NA NA NA NA ...
## $ Pa ne .Economy : ch "Wo ld" "Wo ld" "Wo ld" "Wo ld" ...
## $ P oduc .Sec o .Classi ica ion.Code: ch "SITC3" "SITC3" "SITC3" "SITC3" ...
## $ P oduc .Sec o .Classi ica ion : ch "Me chandise - SITC Re ision 3 (agg ega es)"
"Me chandise - SITC Re ision 3 (agg ega es)" "Me chandise - SITC Re ision 3 (agg ega es)"
"Me chandise - SITC Re ision 3 (agg ega es)" ...
## $ P oduc .Sec o .Code : ch "TO" "TO" "TO" "TO" ...
## $ P oduc .Sec o : ch "To al me chandise" "To al me chandise" "To al me chandise"
"To al me chandise" ...
## $ Pe iod.Code : ch "A" "A" "A" "A" ...
## $ Pe iod : ch "Annual" "Annual" "Annual" "Annual" ...
## $ F equency.Code : ch "A" "A" "A" "A" ...
## $ F equency : ch "Annual" "Annual" "Annual" "Annual" ...
## $ Uni .Code : ch "USM" "USM" "USM" "USM" ...
## $ Uni : ch "Million US dolla " "Million US dolla " "Million US dolla " "Million US
dolla " ...
## $ Yea : in 2001 1994 2002 2000 1993 1992 1990 1995 2006 1979 ...
## $ Value.Flag.Code : ch "" "" "" "" ...
## $ Value.Flag : ch "" "" "" "" ...
## $ Tex .Value : logi NA NA NA NA NA NA ...
## $ Value : num 9940 9154 11969 9171 8785 ...
S anda disa ion
Con e he da a, which is in 1 million USD, in o USD
unique(UnaidedWTO$Uni ) # uni s o da a
## [1] "Million US dolla "
80
These da a do no equi e s anda disa ion
P e-p ocessing
Replace odd alues wi h NA, and emo e commas
names(UnaidedIMF)
## [1] "Coun y" "Subjec .Desc ip o "
## [3] "Uni s" "Scale"
## [5] "Coun y.Se ies.speci ic.No es" "X1980"
## [7] "X1981" "X1982"
## [9] "X1983" "X1984"
## [11] "X1985" "X1986"
## [13] "X1987" "X1988"
## [15] "X1989" "X1990"
## [17] "X1991" "X1992"
## [19] "X1993" "X1994"
## [21] "X1995" "X1996"
## [23] "X1997" "X1998"
## [25] "X1999" "X2000"
## [27] "X2001" "X2002"
## [29] "X2003" "X2004"
## [31] "X2005" "X2006"
## [33] "X2007" "X2008"
## [35] "X2009" "X2010"
## [37] "X2011" "X2012"
## [39] "X2013" "X2014"
## [41] "X2015" "X2016"
## [43] "X2017" "X2018"
## [45] "X2019" "X2020"
## [47] "X2021" "X2022"
## [49] "X2023" "X2024"
## [51] "X2025" "X2026"
## [53] "X2027" "X2028"
## [55] "Es ima es.S a .A e "
mp<-leng h(names(UnaidedIMF))-1
UnaidedIMFPP<-UnaidedIMF[,c(6: mp)] # es ic o columns wi h alues
UnaidedIMFPP[UnaidedIMFPP == "" ] <- NA # eplace missing alue
UnaidedIMFPP[UnaidedIMFPP == "n/a" ] <- NA # eplace odd alue
UnaidedIMFPP[UnaidedIMFPP == "--" ] <- NA # eplace odd alue
UnaidedIMFPP<-as.da a. ame(lapply(UnaidedIMFPP,
unc ion(x) gsub(",", "", x))) # emo e comma in one eco d
mp<-sapply(UnaidedIMFPP, class) # class o da a
mp2<-which( mp == "cha ac e ")
UnaidedIMFPP[ mp2] <- sapply(UnaidedIMFPP[ mp2],as.nume ic, na. m = TRUE) # con e o
nume ic
Agg ega e da a. Fo each yea calcula e he a e age pe cen age change ac oss he coun ies

81
UnaidedIMFPP<-colMeans(UnaidedIMFPP, na. m = T)
C ea e a long o m da ase
Yea <-names(UnaidedIMFPP) # ec o o yea s
Yea <-unlis (s spli (Yea , "X")) # emo e x's om ec o
mp3<-which(Yea == "") # iden i y missing alues
Yea <-Yea [- mp3] # emo e missing alues
UnaidedIMFPP<-as.da a. ame(UnaidedIMFPP)
UnaidedIMFPP<-cbind(Yea , UnaidedIMFPP) # bind alues o yea s
ow.names(UnaidedIMFPP)<-NULL
colnames(UnaidedIMFPP)[2]<-"Pe cen _change" # column name
UnaidedIMFPP$Yea <-as.nume ic(UnaidedIMFPP$Yea )
head(UnaidedIMFPP) # heade o da a
## Yea Pe cen _change
## 1 1980 2.464194
## 2 1981 5.917222
## 3 1982 1.040444
## 4 1983 -4.093417
## 5 1984 2.708750
## 6 1985 5.737000
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(UnaidedIMFPP) # ail o da a
## Yea Pe cen _change
## 44 2023 7.123733
## 45 2024 5.311667
## 46 2025 4.301844
## 47 2026 3.825378
## 48 2027 3.615644
## 49 2028 4.280800
Mos es ima es s a a e 2020, so emo e da a o yea s a e his
mp<-which(UnaidedIMFPP$Yea > 2020)
UnaidedIMFPP<-UnaidedIMFPP[- mp,]
P ocessing
Plo da a
windows(6,4)
pa (ma = c(4,5,1,1))
plo (UnaidedIMFPP$Yea [UnaidedIMFPP$Yea >=2010],
UnaidedIMFPP$Pe cen _change[UnaidedIMFPP$Yea >=2010], pch = 18,
ylab = "Pe cen change in he olume no impo ed goods",
xlab = "Yea ")
Pe o m calcula ions
82
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Unaided_IMF_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(UnaidedIMFPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(UnaidedIMFPP$Yea == Endp)
z<-which(UnaidedIMFPP$Yea == Endn)
Pe cen ageChange<-((UnaidedIMFPP$Pe cen _change[z]-
UnaidedIMFPP$Pe cen _change[y])/UnaidedIMFPP$Pe cen _change[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Pe cen _change[b] != UnaidedIMFPP$Pe cen _change[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(UnaidedIMFPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Pe cen _change[b] != UnaidedIMFPP$Pe cen _change[y]
}
Pa hway<-"unaided:IMF"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (UnaidedIMFPP,
"P ocessed P ocessed_da a Unaided_IMF_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Unaided_IMF. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
83
pa (ma = c(4,5,1,1))
plo (UnaidedIMFPP$Yea [UnaidedIMFPP$Yea >=2010],
UnaidedIMFPP$Pe cen _change[UnaidedIMFPP$Yea >=2010], pch = 18,
ylab = "Pe cen change in he olume no impo ed goods",
xlab = "Yea ")
g aphics.o ()
Plo da a o unaided om bo h he IMF and WTO.
Da a on alue o impo s a e p esen ed as billions o US dolla s
windows(12,16)
pa (m ow = c(2,1))
pa (ma = c(4,5,1,1))
plo (UnaidedWTOPP$Yea , UnaidedWTOPP$Value_2017USD/1000000000,
pch = 18, ylab = "To al me chandise impo s n(billions o US dolla s)",
xlab = "Yea ")
m ex ("A", side = 3, line = 0.2, adj = -0.2)
plo (UnaidedIMFPP$Yea [UnaidedIMFPP$Yea >=2010],
UnaidedIMFPP$Pe cen _change[UnaidedIMFPP$Yea >=2010], pch = 18,
ylab = "Pe cen change in he olume no impo ed goods",
xlab = "Yea ")
m ex ("B", side = 3, line = 0.2, adj = -0.2)
Sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Unaided_IMF_WTO. i ",
wid h = 12, heigh = 16, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (m ow = c(2,1))
pa (ma = c(4,5,1,1))
plo (UnaidedWTOPP$Yea , UnaidedWTOPP$Value_2017USD/1000000000,
pch = 18, ylab = "To al me chandise impo s n(billions o US dolla s)",
xlab = "Yea ")
m ex ("A", side = 3, line = 0.2, adj = -0.2)
plo (UnaidedIMFPP$Yea [UnaidedIMFPP$Yea >=2010],
UnaidedIMFPP$Pe cen _change[UnaidedIMFPP$Yea >=2010], pch = 18,
ylab = "Pe cen change in he olume no impo ed goods",
xlab = "Yea ")
m ex ("B", side = 3, line = 0.2, adj = -0.2)
g aphics.o ()
Escape: Aquacul u e (FishS a J)
Da a on he quan i y o aquacul u e p oduc ion in Sou h A ica we e downloaded om he FishS a J
da abase o he UN’s Food and Ag icul u e O ganisa ion. These a e yea ly da a in onnes. Da a o
a ious ypes o o ganisms we e downloaded and so he e is mo e han one alue pe yea , bu one
ow o he da ase includes he o als o each yea . Da a a e in sho o m.
View da a s uc u e
s (EscAqua) # da a s uc u e
84
## 'da a. ame': 3 obs. o 150 a iables:
## $ Coun y..Name. : ch "Sou h A ica" "To als - Tonnes - li e weigh " "FAO. 2023. Fishe y
and Aquacul u e S a is ics. Global aquacul u e p oduc ion 1950-2021 (FishS a J). In: FAO Fis"|
__ unca ed__
## $ ASFIS.species..Name. : ch "All" "" ""
## $ FAO.majo . ishing.a ea..Name.: ch "All" "" ""
## $ En i onmen ..Name. : ch "All" "" ""
## $ Uni ..Name. : ch "Tonnes - li e weigh " "" ""
## $ Uni : ch "TLW" "" ""
## $ X.1950. : in 0 0 NA
## $ S : ch "..." "" ""
## $ X.1951. : in 0 0 NA
## $ S.1 : ch "..." "" ""
## $ X.1952. : in 0 0 NA
## $ S.2 : ch "..." "" ""
## $ X.1953. : in 0 0 NA
## $ S.3 : ch "..." "" ""
## $ X.1954. : in 0 0 NA
## $ S.4 : ch "..." "" ""
## $ X.1955. : in 0 0 NA
## $ S.5 : ch "..." "" ""
## $ X.1956. : in 0 0 NA
## $ S.6 : ch "..." "" ""
## $ X.1957. : in 0 0 NA
## $ S.7 : ch "..." "" ""
## $ X.1958. : in 0 0 NA
## $ S.8 : ch "..." "" ""
## $ X.1959. : in 0 0 NA
## $ S.9 : ch "..." "" ""
## $ X.1960. : in 0 0 NA
## $ S.10 : ch "..." "" ""
## $ X.1961. : in 0 0 NA
## $ S.11 : ch "..." "" ""
## $ X.1962. : in 0 0 NA
## $ S.12 : ch "..." "" ""
## $ X.1963. : in 0 0 NA
## $ S.13 : ch "..." "" ""
## $ X.1964. : in 0 0 NA
## $ S.14 : ch "..." "" ""
## $ X.1965. : in 0 0 NA
## $ S.15 : ch "..." "" ""
## $ X.1966. : in 0 0 NA
## $ S.16 : ch "..." "" ""
## $ X.1967. : in 0 0 NA
## $ S.17 : ch "..." "" ""
## $ X.1968. : in 0 0 NA
## $ S.18 : ch "..." "" ""
## $ X.1969. : in 0 0 NA
## $ S.19 : ch "..." "" ""
## $ X.1970. : in 0 0 NA
## $ S.20 : ch "N" "" ""
85
## $ X.1971. : in 0 0 NA
## $ S.21 : ch "N" "" ""
## $ X.1972. : in 0 0 NA
## $ S.22 : ch "N" "" ""
## $ X.1973. : in 0 0 NA
## $ S.23 : ch "N" "" ""
## $ X.1974. : in 9 9 NA
## $ S.24 : logi NA NA NA
## $ X.1975. : in 9 9 NA
## $ S.25 : logi NA NA NA
## $ X.1976. : in 9 9 NA
## $ S.26 : logi NA NA NA
## $ X.1977. : in 12 12 NA
## $ S.27 : logi NA NA NA
## $ X.1978. : in 14 14 NA
## $ S.28 : logi NA NA NA
## $ X.1979. : in 14 14 NA
## $ S.29 : logi NA NA NA
## $ X.1980. : in 13 13 NA
## $ S.30 : logi NA NA NA
## $ X.1981. : in 11 11 NA
## $ S.31 : logi NA NA NA
## $ X.1982. : in 10 10 NA
## $ S.32 : logi NA NA NA
## $ X.1983. : in 6 6 NA
## $ S.33 : logi NA NA NA
## $ X.1984. : in 366 366 NA
## $ S.34 : ch "E" "" ""
## $ X.1985. : in 615 615 NA
## $ S.35 : ch "E" "" ""
## $ X.1986. : in 789 789 NA
## $ S.36 : ch "E" "" ""
## $ X.1987. : in 1096 1096 NA
## $ S.37 : ch "E" "" ""
## $ X.1988. : in 1376 1376 NA
## $ S.38 : logi NA NA NA
## $ X.1989. : in 2037 2037 NA
## $ S.39 : logi NA NA NA
## $ X.1990. : in 3613 3613 NA
## $ S.40 : logi NA NA NA
## $ X.1991. : in 4882 4882 NA
## $ S.41 : logi NA NA NA
## $ X.1992. : in 4288 4288 NA
## $ S.42 : logi NA NA NA
## $ X.1993. : in 4021 4021 NA
## $ S.43 : logi NA NA NA
## $ X.1994. : in 4429 4429 NA
## $ S.44 : logi NA NA NA
## $ X.1995. : in 3530 3530 NA
## $ S.45 : logi NA NA NA

86
## $ X.1996. : in 3013 3013 NA
## [lis ou pu unca ed]
S anda disa ion
These da a do no need o be s anda dised
P e-p ocessing
Res ic da ase o equi ed ows and columns.
Some columns do no con ain da a, and only he ow o da a wi h he o al quan i y p oduced pe
yea is equi ed.
names(EscAqua) # column names
## [1] "Coun y..Name." "ASFIS.species..Name."
## [3] "FAO.majo . ishing.a ea..Name." "En i onmen ..Name."
## [5] "Uni ..Name." "Uni "
## [7] "X.1950." "S"
## [9] "X.1951." "S.1"
## [11] "X.1952." "S.2"
## [13] "X.1953." "S.3"
## [15] "X.1954." "S.4"
## [17] "X.1955." "S.5"
## [19] "X.1956." "S.6"
## [21] "X.1957." "S.7"
## [23] "X.1958." "S.8"
## [25] "X.1959." "S.9"
## [27] "X.1960." "S.10"
## [29] "X.1961." "S.11"
## [31] "X.1962." "S.12"
## [33] "X.1963." "S.13"
## [35] "X.1964." "S.14"
## [37] "X.1965." "S.15"
## [39] "X.1966." "S.16"
## [41] "X.1967." "S.17"
## [43] "X.1968." "S.18"
## [45] "X.1969." "S.19"
## [47] "X.1970." "S.20"
## [49] "X.1971." "S.21"
## [51] "X.1972." "S.22"
## [53] "X.1973." "S.23"
## [55] "X.1974." "S.24"
## [57] "X.1975." "S.25"
## [59] "X.1976." "S.26"
## [61] "X.1977." "S.27"
## [63] "X.1978." "S.28"
## [65] "X.1979." "S.29"
## [67] "X.1980." "S.30"
## [69] "X.1981." "S.31"
## [71] "X.1982." "S.32"
## [73] "X.1983." "S.33"
87
## [75] "X.1984." "S.34"
## [77] "X.1985." "S.35"
## [79] "X.1986." "S.36"
## [81] "X.1987." "S.37"
## [83] "X.1988." "S.38"
## [85] "X.1989." "S.39"
## [87] "X.1990." "S.40"
## [89] "X.1991." "S.41"
## [91] "X.1992." "S.42"
## [93] "X.1993." "S.43"
## [95] "X.1994." "S.44"
## [97] "X.1995." "S.45"
## [99] "X.1996." "S.46"
## [101] "X.1997." "S.47"
## [103] "X.1998." "S.48"
## [105] "X.1999." "S.49"
## [107] "X.2000." "S.50"
## [109] "X.2001." "S.51"
## [111] "X.2002." "S.52"
## [113] "X.2003." "S.53"
## [115] "X.2004." "S.54"
## [117] "X.2005." "S.55"
## [119] "X.2006." "S.56"
## [121] "X.2007." "S.57"
## [123] "X.2008." "S.58"
## [125] "X.2009." "S.59"
## [127] "X.2010." "S.60"
## [129] "X.2011." "S.61"
## [131] "X.2012." "S.62"
## [133] "X.2013." "S.63"
## [135] "X.2014." "S.64"
## [137] "X.2015." "S.65"
## [139] "X.2016." "S.66"
## [141] "X.2017." "S.67"
## [143] "X.2018." "S.68"
## [145] "X.2019." "S.69"
## [147] "X.2020." "S.70"
## [149] "X.2021." "S.71"
ColNum<-seq(7, leng h(names(EscAqua)), 2) # column numbe s whe e alues a e s o ed
EscAquaPP<-EscAqua[2,ColNum] # es ic da ase
C ea e a long o m da ase
Yea <-names(EscAquaPP) # c ea e a ec o o yea
Yea <-unlis (s spli (Yea , "X.")) # emo e X.s
Yea <-unlis (s spli (Yea , spli =".", ixed = TRUE)) # emo e poin s
Yea # inal yea ec o
## [1] "1950" "1951" "1952" "1953" "1954" "1955" "1956" "1957" "1958" "1959"
## [11] "1960" "1961" "1962" "1963" "1964" "1965" "1966" "1967" "1968" "1969"
## [21] "1970" "1971" "1972" "1973" "1974" "1975" "1976" "1977" "1978" "1979"
88
## [31] "1980" "1981" "1982" "1983" "1984" "1985" "1986" "1987" "1988" "1989"
## [41] "1990" "1991" "1992" "1993" "1994" "1995" "1996" "1997" "1998" "1999"
## [51] "2000" "2001" "2002" "2003" "2004" "2005" "2006" "2007" "2008" "2009"
## [61] "2010" "2011" "2012" "2013" "2014" "2015" "2016" "2017" "2018" "2019"
## [71] "2020" "2021"
Quan i y<-as. ec o (EscAquaPP,mode='nume ic')# ec o o he alues
EscAquaPP<-cbind(Yea , Quan i y) # bind yea and quan i y ec o s
EscAquaPP<-as.da a. ame(EscAquaPP) # da a ame
EscAquaPP$Yea <-as.nume ic(EscAquaPP$Yea ) # con e he da a o nume ic
EscAquaPP$Quan i y<-as.nume ic(EscAquaPP$Quan i y) # con e o nume ic
head(EscAquaPP) # heade
## Yea Quan i y
## 1 1950 0
## 2 1951 0
## 3 1952 0
## 4 1953 0
## 5 1954 0
## 6 1955 0
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(EscAquaPP) # ail o da a
## Yea Quan i y
## 67 2016 8094.27
## 68 2017 6338.32
## 69 2018 7991.55
## 70 2019 9224.32
## 71 2020 9753.01
## 72 2021 10525.32
No adjus men s equi ed
P ocessing
Plo da a
windows(6,4)
pa (ma = c(4,5,1,1))
plo (EscAquaPP$Yea , EscAquaPP$Quan i y, pch = 18,
ylab = "Aquacul u e p oduc ion n( onnes)", xlab = "Yea ")
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
89
P e Da <-
ead.cs ("P ocessed_da a_p e ious_ epo Escape_aquacul u e_FISHSTATJ_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(EscAquaPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(EscAquaPP$Yea == Endp)
z<-which(EscAquaPP$Yea == Endn)
Pe cen ageChange<-((EscAquaPP$Quan i y[z]-
EscAquaPP$Quan i y[y])/EscAquaPP$Quan i y[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != EscAquaPP$Quan i y[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(EscAquaPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != EscAquaPP$Quan i y[y]
}
Pa hway<-"escape:aquacul u eFishS a J"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (EscAquaPP,
"P ocessed P ocessed_da a Escape_aquacul u e_FISHSTATJ_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Escape_aquacul u e_FISHSTATJ. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (EscAquaPP$Yea , EscAquaPP$Quan i y, pch = 18,
ylab = "Aquacul u e p oduc ion n( onnes)", xlab = "Yea ")
g aphics.o ()
96
z<-which(S owFishCa chPP$Yea == Endn)
Pe cen ageChange<-((S owFishCa chPP$Quan i y[z]-
S owFishCa chPP$Quan i y[y])/S owFishCa chPP$Quan i y[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != S owFishCa chPP$Quan i y[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(S owFishCa chPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != S owFishCa chPP$Quan i y[y]
}
Pa hway<-"s owaway: ishingFishS a J"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (S owFishCa chPP,
"P ocessed P ocessed_da a S owaway_ ishing_FISHSTATJ_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s S owaway_ ishing_FISHSTATJ. i ",
wid h = 6, heigh = 4, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (S owFishCa chPP$Yea , S owFishCa chPP$Quan i y/1000,
pch = 18, ylab = "Quan i y o ish caugh n( housand onnes)", xlab = "Yea ", ylim = c(0,2200))
g aphics.o ()
S owaway: People and hei luggage/equipmen ; S owaway: Vehicles (S a sSA)
Da a on he o al numbe o o eign a ele s and Sou h A ican esiden s a i ing in Sou h A ica
mon hly we e ob ained om S a is ics Sou h A ica. The da a includes he o al numbe a i ing, and
he numbe a i ing a di e en po s o en y. The e o e, he e is mo e han one alue pe yea .
The o iginal da a we e downloaded as a pd , bu manually p ocessed in p e ious s eps o his
wo k low.
View da a s uc u e
s (S owPeopVeh) # da a s uc u e

97
## 'da a. ame': 21 obs. o 3 a iables:
## $ Yea : in 2016 2017 2018 2019 2020 2021 2022 2016 2017 2018 ...
## $ Numbe : in 5379569 5700909 5866531 5764311 1529488 1211859 3694507 16190439
15921082 15860569 ...
## $ T anspo : ch "ai " "ai " "ai " "ai " ...
S anda disa ion
These da a do no need o be s anda dised.
P e-p ocessing
Agg ega e da a
S owPeopVehPP <- agg ega e(S owPeopVeh$Numbe , by = lis (S owPeopVeh$Yea ), FUN = sum)
colnames(S owPeopVehPP)<-c("Yea ", "Numbe ") # se column names
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owPeopVehPP) # ail o da a
## Yea Numbe
## 2 2017 21703731
## 3 2018 21876833
## 4 2019 21828864
## 5 2020 6414436
## 6 2021 4606742
## 7 2022 11540047
No adjus men s equi ed
P ocessing
Plo da a
Ai anspo da a a e p esen ed as millions o a i als; oad anspo da a a e p esen ed as millions
o a i als; and sea anspo da a a e p esen ed as housands o a i als.
windows(6,12)
pa (m ow = c(3,1))
pa (ma = c(4,5,1,1))
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == "ai "]/1000000,
ylab = "Numbe o a i als n(millions)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black")
m ex ("A", side = 3, line = -0.5, adj = -0.2)
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == " oad"]/1000000,
ylab = "Numbe o a i als n(millions)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black")
m ex ("B", side = 3, line = -0.5, adj = -0.2)
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == "sea"]/1000,
ylab = "Numbe o a i als n( housands)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black")
m ex ("C", side = 3, line = -0.5, adj = -0.2)
98
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <-
ead.cs ("P ocessed_da a_p e ious_ epo S owaway_people_ ehicles_STATSSA_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(S owPeopVehPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(S owPeopVehPP$Yea == Endp)
z<-which(S owPeopVehPP$Yea == Endn)
Pe cen ageChange<-((S owPeopVehPP$Numbe [z]-
S owPeopVehPP$Numbe [y])/S owPeopVehPP$Numbe [y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != S owPeopVehPP$Numbe [y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(S owPeopVehPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Numbe [b] != S owPeopVehPP$Numbe [y]
}
Pa hway<-"s owaway:people_ ehiclesSTATSSA"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (S owPeopVehPP,
"P ocessed P ocessed_da a S owaway_people_ ehicles_STATSSA_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
99
i ( ilename = "P ocessed Plo s S owaway_people_ ehicles_STATSSA. i ",
wid h = 6, heigh = 12, uni s = "in",
comp ession = "lzw", bg = "whi e", es = 1000)
pa (m ow = c(3,1))
pa (ma = c(4,8,1,1))
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == "ai "]/1000000,
ylab = "Numbe o a i als n(millions)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black", cex.axis = 2, cex.names = 2,
cex.lab = 2.5)
m ex ("A", side = 3, line = -1.4, adj = -0.2, cex = 2.5)
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == " oad"]/1000000,
ylab = "Numbe o a i als n(millions)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black", cex.axis = 2, cex.names = 2,
cex.lab = 2.5)
m ex ("B", side = 3, line = -1.4, adj = -0.2, cex = 2.5)
ba plo (S owPeopVeh$Numbe [S owPeopVeh$T anspo == "sea"]/1000,
ylab = "Numbe o a i als n( housands)",
xlab = "Yea ", names.a g = unique(S owPeopVeh$Yea ), col = "black", cex.axis = 2, cex.names = 2,
cex.lab = 2.5)
m ex ("C", side = 3, line = -1.4, adj = -0.2, cex = 2.5)
g aphics.o ()
S owaway: People and hei luggage (WTTC)
Da a on he o al, yea ly con ibu ion o ou ism and a el o Sou h A ica’s GDP we e downloaded
om he Wo ld Tou ism and T a el Council. Da a a e in bn US$ a eal p ices, and a e in sho o m.
View da a s uc u e
s (S owPeopWTTC) # da a s uc u e
## 'da a. ame': 3 obs. o 36 a iables:
## $ To al.con ibu ion. o.GDP: ch "Sou h A ica" "US$ in bn (Real p ices)" "Sou ce: WTTC"
## $ X1995 : num NA 10.9 NA
## $ X1996 : num NA 13.5 NA
## $ X1997 : num NA 15 NA
## $ X1998 : num NA 15.3 NA
## $ X1999 : num NA 15.8 NA
## $ X2000 : num NA 16.5 NA
## $ X2001 : num NA 18.4 NA
## $ X2002 : num NA 21.3 NA
## $ X2003 : num NA 22.1 NA
## $ X2004 : num NA 22.8 NA
## $ X2005 : num NA 25.7 NA
## $ X2006 : num NA 29.9 NA
## $ X2007 : num NA 30.7 NA
## $ X2008 : num NA 30.4 NA
## $ X2009 : num NA 29.5 NA
## $ X2010 : num NA 29.5 NA
## $ X2011 : num NA 28.9 NA
## $ X2012 : num NA 31.3 NA
## $ X2013 : num NA 32.3 NA
100
## $ X2014 : num NA 33.4 NA
## $ X2015 : num NA 33.2 NA
## $ X2016 : num NA 33.3 NA
## $ X2017 : num NA 32.7 NA
## $ X2018 : num NA 32.1 NA
## $ X2019 : num NA 33.3 NA
## $ X2020 : num NA 34.1 NA
## $ X2021 : num NA 35.1 NA
## $ X2022 : num NA 36.1 NA
## $ X2023 : num NA 37.4 NA
## $ X2024 : num NA 38.6 NA
## $ X2025 : num NA 39.9 NA
## $ X2026 : num NA 41.3 NA
## $ X2027 : num NA 42.9 NA
## $ X2028 : num NA 44.4 NA
## $ X2029 : num NA 46.2 NA
S anda disa ion
Con e he da a, which is in billion USD, in o USD
names(S owPeopWTTC) # column names
## [1] "To al.con ibu ion. o.GDP" "X1995"
## [3] "X1996" "X1997"
## [5] "X1998" "X1999"
## [7] "X2000" "X2001"
## [9] "X2002" "X2003"
## [11] "X2004" "X2005"
## [13] "X2006" "X2007"
## [15] "X2008" "X2009"
## [17] "X2010" "X2011"
## [19] "X2012" "X2013"
## [21] "X2014" "X2015"
## [23] "X2016" "X2017"
## [25] "X2018" "X2019"
## [27] "X2020" "X2021"
## [29] "X2022" "X2023"
## [31] "X2024" "X2025"
## [33] "X2026" "X2027"
## [35] "X2028" "X2029"
S owPeopWTTCS<-S owPeopWTTC
ColNum<-2:leng h(names(S owPeopWTTCS))
S owPeopWTTCS<-S owPeopWTTCS[2,ColNum]
S owPeopWTTCS[1,]<-S owPeopWTTCS[1,]*1000000000 # mul iply alues by 1 billion
P e-p ocessing
Reo ganise da a so ha i is in long o m
Yea <-colnames(S owPeopWTTCS) # con e column names (Yea s) in o a ec o
Yea <-unlis (s spli (Yea , "X")) # emo e Xs
mp<-which(Yea == "") # which alues a e missing
101
Yea <-Yea [- mp] # emo e missing alues
Yea # look a ec o
## [1] "1995" "1996" "1997" "1998" "1999" "2000" "2001" "2002" "2003" "2004"
## [11] "2005" "2006" "2007" "2008" "2009" "2010" "2011" "2012" "2013" "2014"
## [21] "2015" "2016" "2017" "2018" "2019" "2020" "2021" "2022" "2023" "2024"
## [31] "2025" "2026" "2027" "2028" "2029"
Value<-as. ec o (S owPeopWTTCS[1,],mode='nume ic') # c ea e a ec o o he alues
S owPeopWTTCPP<-as.da a. ame(cbind(as.nume ic(Yea ), as.nume ic(Value))) # c ea e long o m
da ase
colnames(S owPeopWTTCPP)<-c("Yea ", "GDPCon ibu ion_USD") # se column names
head(S owPeopWTTCPP) # heade o da a
## Yea GDPCon ibu ion_USD
## 1 1995 10925800000
## 2 1996 13485100000
## 3 1997 14973800000
## 4 1998 15254700000
## 5 1999 15770700000
## 6 2000 16533900000
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(S owPeopWTTCPP) # ail o da a
## Yea GDPCon ibu ion_USD
## 30 2024 38649000000
## 31 2025 39947300000
## 32 2026 41328600000
## 33 2027 42877200000
## 34 2028 44448900000
## 35 2029 46242900000
Da a om 2018 a e es ima es, so emo e hese da a
mp<-which(S owPeopWTTCPP$Yea >2018)
S owPeopWTTCPP<-S owPeopWTTCPP[- mp,]
P ocessing
Plo da a
Da a a e p esen ed as billions o US dolla s.
windows(6,4)
pa (ma = c(4,5,1,1))
plo (S owPeopWTTCPP$Yea , S owPeopWTTCPP$GDPCon ibu ion_USD/1000000000,
pch = 18, ylab = "Con ibu ion o GDP n(billion US dolla s a eal p ices)",
xlab = "Yea ", ylim = c(0,50))
Pe o m calcula ions

102
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo S owaway_people_WTTC_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo has changed, and i
new da a a e a ailable, calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(S owPeopWTTCPP$Yea )
x<-Endn-Endp
i (x>0){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(S owPeopWTTCPP$Yea == Endp)
z<-which(S owPeopWTTCPP$Yea == Endn)
Pe cen ageChange<-((SS owPeopWTTCPP$GDPCon ibu ion_USD[z]-
S owPeopWTTCPP$GDPCon ibu ion_USD[y])/
S owPeopWTTCPP$GDPCon ibu ion_USD[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $GDPCon ibu ion_USD[b] != S owPeopWTTCPP$GDPCon ibu ion_USD[y]
}
i (x==0){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(S owPeopWTTCPP$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $GDPCon ibu ion_USD[b] != S owPeopWTTCPP$GDPCon ibu ion_USD[y]
}
Pa hway<-"s owaway:peopleWTTC"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (S owPeopWTTCPP,
"P ocessed P ocessed_da a S owaway_people_WTTC_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ", ow.names=F,
append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s S owaway_people_WTTC. i ",
wid h = 6, heigh = 4, uni s = "in",
103
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (S owPeopWTTCPP$Yea , S owPeopWTTCPP$GDPCon ibu ion_USD/1000000000,
pch = 18, ylab = "Con ibu ion o GDP n(billion US dolla s a eal p ices)",
xlab = "Yea ", ylim = c(0,50))
g aphics.o ()
Con aminan : Seeds
Da a on he quan i y o ag onomic seed impo ed e e y yea we e ob ained om he Depa men o
Ag icul u e, Land e o m and Ru al De elopmen . The uni s is onnes. The o iginal da a we e
downloaded as a pd , and we e p ocessed manually in p e ious s eps o his wo k low.
View da a s uc u e
s (Con Seed) # da a s uc u e
## 'da a. ame': 11 obs. o 2 a iables:
## $ Yea : in 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 ...
## $ Quan i y: num 5818 91696 38207 39089 274131 ...
S anda disa ion
Da a do no need o be s anda dised
P e-p ocessing
Check o issues wi h ecen da a and make necessa y adjus men s. Fo example, da a o
incomple e yea s included, o da a alues indica e ha he da a a e no accu a e (e.g. no all da a
has been submi ed)
ail(Con Seed) # ail o da a
## Yea Quan i y
## 6 2013 83773.0
## 7 2014 155535.0
## 8 2015 80190.0
## 9 2016 388352.0
## 10 2017 142856.7
## 11 2018 39026.0
No adjus men s equi ed
P ocessing
Plo da a
Da a will be p esen ed in housand onnes
windows(6,4)
pa (ma = c(4,5,1,1))
plo (Con Seed$Yea , Con Seed$Quan i y/1000, pch = 18,
ylab = "Quan i y o impo ed seed n( housand onnes)",
xlab = "Yea ", ylim = c(0, 500))
104
Pe o m calcula ions
Read in p ocessed da a used in p e ious epo . These da a ha e been sa ed in he
‘P ocessed_da a_p e ious_ epo ’ olde .
Pas e he ile pa h o he equi ed ile in he quo a ion ma ks in he code below (i.e. eplace he ile
pa h in he b acke s wi h ha o he equi ed ile). Inse double backslashes whe e equi ed
P e Da <- ead.cs ("P ocessed_da a_p e ious_ epo Con aminan _seeds_DALRRD_p ocessed.cs ")
See i new da a ha e become a ailable, i he baseline om he p e ious epo ha e changed, and i
new da a a e a ailable calcula e he pe cen age change.
Endp<-max(P e Da $Yea )
Endn<-max(Con Seed$Yea )
x<-Endn==Endp
i (x == FALSE){
ChangeScena io<-"NewDa aFo Recen Yea s"
y<-which(Con Seed$Yea == Endp)
z<-which(Con Seed$Yea == Endn)
Pe cen ageChange<-((Con Seed$Quan i y[z]-
Con Seed$Quan i y[y])/Con Seed$Quan i y[y])*100
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != Con Seed$Quan i y[y]
}
i (x==TRUE){
ChangeScena io<-"NoNewDa aFo Recen Yea s"
Pe cen ageChange<-NA
y<-which(Con Seed$Yea == Endp)
b<-which(P e Da $Yea == Endp)
BaseChange<-P e Da $Quan i y[b] != Con Seed$Quan i y[y]
}
Pa hway<-"con aminan :seedsDALRRD"
esul s<-cbind(Pa hway, ChangeScena io, Pe cen ageChange, BaseChange)
Pos -p ocessing
The p ocessed da a a e sa ed in cs o ma in he olde ‘P ocessed_da a’ which was c ea ed in
p e ious s eps
w i e.cs (Con Seed,
"P ocessed P ocessed_da a Con aminan _seeds_DALRRD_p ocessed.cs ",
ow.names = FALSE)
The ou pu s on changes o he da a since he las epo a e w i en o he ‘Change_ acking’ cs in
he ‘P ocessed’ olde .
w i e. able( esul s,"P ocessed Change_ acking.cs ",
ow.names=F, append=T, quo e= FALSE, sep=",", col.names = F)
The plo is sa ed as a i in he plo s olde c ea ed in p e ious s eps.
i ( ilename = "P ocessed Plo s Con aminan _seeds_DALRRD. i ",
wid h = 6, heigh = 4, uni s = "in",
105
comp ession = "lzw", bg = "whi e", es = 1000)
pa (ma = c(4,5,1,1))
plo (Con Seed$Yea , Con Seed$Quan i y/1000, pch = 18,
ylab = "Quan i y o impo ed seed n( housand onnes)",
xlab = "Yea ", ylim = c(0, 500))
g aphics.o ()
112
Upda ing he pe mi da abase
Sugges ed ci a ion: SANBI and CIB 2023. Appendix 4 o "The S a us o Biological In asions and hei
Managemen in Sou h A ica in 2022"—Wo k lows: Upda ing he pe mi da abase. Sou h A ican
Na ional Biodi e si y Ins i u e, Ki s enbosch and DSI-NRF Cen e o Excellence o In asion Biology,
S ellenbosch. h p://dx.doi.o g/10.5281/zenodo.8217222
1. In Janua y eques an upda ed pe mi da abase om he Depa men o Fo es y, Fishe ies and
he En i onmen : En i onmen al P og ammes, Biosecu i y—Pe mi ing sub di ec o a e
2. Focus only on pe mi s issued. Applica ions and e usals o applica ions can be o a numbe o
easons ela ed o adminis a i e issues and no o do wi h he isks in ol ed. In u u e a sepa a e
p ocess migh be needed o look a hose. Manually check he las ew pe mi s issued om he
p e ious yea wi h hose issued his yea so ha i is clea which pe mi s o add.
3. C ea e a wo kshee ha explains all he da a cleaning done in con e ing he DFFE's da abase o
he pe mi da abase (e.g., NEMBA AandIS pe mi s 2014–2022 20230509 edi ed iles.xlsx). The
b oad s eps in ol ed a e desc ibed below, bu see he ile i sel o de ails.
A sepa a e ile no ing que ies is cap u ed and sen back o DFFE.
edi ed: Copied wi hou o ma ing, emo ed emp y lines be ween mon hs / inancial yea s. In cases
whe e mul iple pe mi s a e issued o one pe son make su e he de ails a e in mul iple ow s(i.e.,
he e a e no ows wi h me ged cells); check ha he e a e no emp y cells, and i he e a e ei he ill
wi h neighbou ing ows i he esul o me ged cells o add NA. Add a no es column o cap u e any
loa ing no es on he o iginal.
edi ed 2: emo ed columns "Pe mi applica ion a ended by:". Da e Recei ed, Pe mi issue da e,
Pe mi expi y da e, in o ma cus om '[$-en-ZA]d mmm yyyy]', isual check o da a and co ec ypos.
Check o e lap be ween da a o be added and new da a, and dele e ows al eady cap u ed. So all
he da es o see unusually la ge and small alues, also check ha ecei ed is ea lie o he same as
issued and he expi e is la e han issued (e.g., add a new cell and pu in a o mula sub ac ing one
om he o he ). Add in missing da es, e en i missing om o iginal da abase as can usually calcula e
om issued da e, expi y da e, and leng h o pe mi .
edi ed 3: (in u u e do s ep 4 i s ) sepa a ed species in o unique ows (no e he same pe mi can
ha e se e al axa on i ).
edi ed 4: (in u u e do be o e s ep 3) checked h ough pe mi numbe s copied jus illed cells ac oss
(no whole sp eadshee ). C ea e a column 'pe mi Numbe ' and add a P a he on so all s o ed as
ex . Check he leng h o he pe mi numbe s using he unc ion len(). Including he P he e should
be 18 cha ac e s, bu in a ew cases he las 0 is missing ( his was added back in manually) and in a
ew o he cases he pe mi numbe was 19 cha ac e s (checked wi h DFFE). No e i he digi s go
abo e 15 hen hey ha e o be s o ed as ex as o he wise Excel cu s o he numbe . One pe mi
was issued o Ga den Rou e Na ional Pa k o possession on 29 Sep 2022, bu he e a e ou species
codes, PS.2551|BS.2551|MIS.2551|FS.2551, duplica ion emo ed
Column added 'du a ion' and alidi y o pe mi s column con e ed o mon hs and dele ed (in one
case i was missing so i was added based on issue and expi y da e); added pe mi issue da es whe e
los du ing deme ging o cells
=IF(OR(S483="yea s",S483="yea "),R483*12,IF(S483="mon hs",R483,NA))

113
edi ed 5: Spli "Type o Pe mi " in o he ca ego ies no ed below and added columns o each ac i i y
and ei he "TRUE" o "F" ( a he han FALSE o ensu e i is easy o see)
Need o edi he easons a pe mi was issued so hey align wi h he egula ions as a ious ex is
used in he da abase. F om No ice 1 o he NEM:BA A&IS lis s 2020 whe e a–e as de ined in he Ac ;
–l as in Chap e 6 o he Regula ions
impo = a. Impo ing in o he Republic, including in oducing om he sea, any specimen o a lis ed
in asi e species.
possess = b. Ha ing in possession o exe cising physical con ol o e any specimen o a lis ed in asi e
species.
b eed = c. G owing, b eeding o in any o he way p opaga ing any specimen o a lis ed in asi e
species, o causing i o mul iply.
con ey = d. Con eying, mo ing o o he wise ansloca ing any specimen o a lis ed in asi e species.
ade = e. Selling o o he wise ading in, buying, ecei ing, gi ing, dona ing o accep ing as a gi , o
in any way acqui ing o disposing o any specimen o a lis ed in asi e species.
sp ead = . Sp eading o allowing he sp ead o any specimen o a lis ed in asi e species.
eleasing = g. Releasing any specimen o a lis ed in asi e species.
mo e. w = h. The ans e o elease o a specimen o a lis ed in asi e esh-wa e species om one
disc e e ca chmen sys em in which i occu s, o ano he disc e e ca chmen sys em in which i does
no occu ; o , om wi hin a pa o a disc e e ca chmen sys em whe e i does occu o ano he pa
whe e i does no occu as a esul o a na u al o a i icial ba ie .
discha ge = i. Discha ging o o disposing in o any wa e way o he ocean, wa e om an aqua ium,
ank o o he ecep acle ha has been used o keep a specimen o an alien o a lis ed in asi e
species.
ca ch.and. elease = j. Ca ch and elease o a specimen o a lis ed in asi e esh-wa e ish o lis ed
in asi e esh-wa e in e eb a e species.
ake. o.island = k. The in oduc ion o a specimen o an alien o a lis ed in asi e species o o -sho e
islands.
elease. w = l. The elease o a specimen o a lis ed in asi e esh-wa e ish species, o o a lis ed
in asi e esh-wa e in e eb a e species, in o a disc e e ca chmen sys em in which i al eady
occu s.
esea ch = (1) Despi e any hing o he con a y in hese egula ions, a pe mi may be issued
subjec o pe mi condi ions, o a scien i ic ins i u ion o ca y ou a es ic ed ac i i y in ol ing a
specimen o an alien o lis ed in asi e species, and mus be issued unde he condi ions ha he
specimen mus —
(a) be kep o iden i ica ion o esea ch pu poses only;
biocon ol = (1) Despi e any hing o he con a y in hese egula ions, a pe mi may be issued
subjec o pe mi condi ions, o a scien i ic ins i u ion o ca y ou a es ic ed ac i i y in ol ing a
114
specimen o an alien o lis ed in asi e species, and mus be issued unde he condi ions ha he
specimen mus —
(b) o m pa o a p elimina y s udy in o biological con ol me hods; o
(c) o m pa o an e ec i e biological con ol p og amme.
display = (3) Despi e any hing o he con a y in hese egula ions, a pe mi may be issued, subjec
o pe mi condi ions, o a zoological o bo anical ins i u ion o ca y ou a es ic ed ac i i y in ol ing
a specimen o an alien o lis ed in asi e species, including o display pu poses.
in e .basin = (5) Despi e any hing o he con a y in hese egula ions, a pe mi may be issued,
subjec o pe mi condi ions, o he ans e o a specimen o an alien o lis ed in asi e species om
one esh-wa e sys em in which i occu s o ano he eshwa e sys em in which i does no occu
h ough a s a e in e -basin ans e scheme.
No e he e is no di e ence be ween buy and sell in he egula ions, al hough bo h e ms a e used in
he pe mi da abase
I a pe mi was issued o possession o esea ch and an accompanying pe mi was issued o
con eyance, hen he con eyance pe mi is assumed o also be o esea ch. Resea ch was i lagged
excep Na ional Zoological Ga dens o Sou h A ica o display pu poses; and Rhodes Uni e si y a
named pe son pa o he Cen e o Biological Con ol and Ag icul u al Resea ch Council a named
pe son pa o he Plan Heal h P o ec ion g oup o biocon ol pu poses
edi ed 6: column headings changed o align wi h he inal column headings (and so compa ible wi h
R) wi h he excep ion he i s column is pe mi Name (align wi h scien i icName is he nex s ep).
This in ol es he emo al o he columns: Species Code, Applican , Con ac numbe , Loca ion whe e
he es ic ed ac i i y will ake place, P o ince, Res ic ed ac i i y in ol ed, Type o Pe mi . This is
he inal s age a which he o iginal o de is main ained
edi ed 7: he da abase is so ed by pe mi Name and aligned o scien i icName as pe he 2020
egula o y lis s whe e possible, i he e is a de ia ion be ween he egula o y name and he name on
he pe mi his is lagged in he no es. Check o changes in nomencla u e in pas names.
The da abase does no include any in o ma ion on he lis ing ca ego y. Look a
<NEMBA_AandIS_Regula o y_Lis s_20230503.xlsx> o simila , no ing ha i is impo an o
ecognise ha he cu en lis ing ca ego y migh di e om he lis ing ca ego y when he pe mi
was issued.
...As a inal check ensu e ha all he cells wi h TRUE o F a e o ma ed he same way (including
alignmen ) and do a sea ch and eplace o each e m (ma ch ull cell con en s). O he wise so ing
he cells A o Z migh no wo k.
5. Sa e he changes made, and c ea e an upda ed ile wi h all he pe mi s o he o m
<NEMBA_A&IS_pe mi s_issued_2014–20XX.xlsx>. Backup he in e media y edi ed ile, no e ha his
ile canno be made publicly accessible as i con ains sensi i e in o ma ion.
6. Log on o Zenodo using he s a us epo 's Zenodo accoun and go o
h ps://dx.doi.o g/10.5281/zenodo.3947809. The goal is o upda e he e sion on-line, he i s s ep
is o ese e a new doi. This doi is hen used wi hin he ile c ea ed and in he me ada a on he
Zenodo web-si e. Once all documen s a e upda ed, publish he ile on-line.
115
7. Sha e wi h DFFE and p o ide que ies / eed-back, edi he ile and epublish o Zenodo as
necessa y.
8. When i comes o analysing he da abase in R, sa e he ile as a ex ab-delimi ed ile hen eplace
all apos ophes in au ho i y names (i.e. ') wi h ano he cha ac e , e.g., an unde sco e.
9. The ollowing code is o make g aphs o pe mi s issued pe mon h o e ime and o ge numbe s
o pe mi s pe species
#make su e he ex ile has emo ed ? (i.e. accen s e c.)
se wd("C: Use s j wilson Desk op")
#
se wd("C: docs p ojec s Lis ing and lis s DFFE pe mi da abase")
pe mi <- ead. able("NEMBA_AandIS_pe mi s_issued_2014–2022. x ",sep=" ",heade =T)
pe mi $issued<-as.Da e(pe mi $issued,"%d %b %Y")
pe mi $ ecei ed<-as.Da e(pe mi $ ecei ed,"%d %b %Y")
pe mi $expi es<-as.Da e(pe mi $expi es,"%d %b %Y")
# emo e pe mi s wi h he same pe mi numbe , no e his will emo e di e en species so don' use
his o speceis anlayses
pe mi .unique <- pe mi [!duplica ed(pe mi $pe mi Numbe ), ]
pe mi .unique.ca 2 <- pe mi .unique[!(pe mi .unique$ esea ch | pe mi .unique$biocon ol |
pe mi .unique$display |pe mi .unique$in e .basin),]
#con e o numbe o pe mi s pe calenda mon h
lib a y(lub ida e)
x2 <- loo _da e(pe mi .unique$issued,uni ="mon h")
mon h(x2)
so (pe mi .unique$issued)
able(x2)
w i e. able( able(x2),"a. x ")
lib a y(lub ida e); x2 <- loo _da e(pe mi .unique.ca 2$issued,uni ="mon h"); mon h(x2);
so (pe mi .unique$issued); able(x2); w i e. able( able(x2),"aCa 2. x ")
#####################
###add in missing mon hs in Excel in o a ile called da es
################################
po e <- ead. able("da esALL. x ",sep=" ",heade =T)
po e Ca 2 <- ead. able("da esCa 2. x ",sep=" ",heade =T)
po e Ca 2$da e<-as.Da e(po e Ca 2$da e, o ma ="%Y/%m/%d")
als <- ba plo (po e $numpe mi s,ann=F,ylim=c(0,100),plo =F)
windows(6,3)
pa (ma =c(4,6,0.5,0),las=1)
ba plo (po e $numpe mi s,ann=F,col="g ey20",ylim=c(0,100))
ba plo (po e Ca 2$numpe mi s,ann=F,add=T,col="g ey80")
legend(" op igh ",b y="n", ill=c("g ey20","g ey80"),c(" esea ch, biocon ol, e c..","ca ego y 2"))
axis(1,a = als[seq(1,100,12)],labels=c("Jan 2015",2016:2023))
m ex (side=1,line=3,"Mon h")
116
m ex (side=2,line=4,adj=0.5,"Numbe no npe mi s nissued")
####Numbe o pe mi s pe species (assumes each en y ep esen s a di e en pe mi )
#numbe o species wi h pe mi s issued on hem
leng h(unique(pe mi $scien icName))
xx <- pe mi $scien icName
#xx <- pe mi $scien icName[pe mi $ esea ch==F & pe mi $biocon ol==F & pe mi $display==F &
pe mi $in e .basin==F]
xx<-as. ac o (xx)
ou <-da a. ame(names( able(xx)),as.nume ic( able(xx)))
names(ou )<-c("species","numpe mi s")
ba plo (ou $numpe mi s)
x2<- able(ou $numpe mi s)
windows(6,3)
pa (ma =c(4,6,0.5,0),las=1)
plo (as.nume ic(names(x2)),as.nume ic(x2),log="x", ype="h",ann=F,b y="n",lwd=3)
axis(1,a =c(1,1000),labels=c("",""))
axis(2,a =seq(0,100,10))
m ex (side=1,line=3,"Numbe o pe mi s issued")
m ex (side=2,line=4,adj=0.5,"Numbe no n axa")
#pe mi s pe axon
cumsum(so (ou $numpe mi s))/sum(ou $numpe mi s)
cumsum(x2)/sum(x2)
w i e. able(ou ,"a. x ")
# epea only o pe iod
xx <- pe mi $scien icName[pe mi $ esea ch==F & pe mi $biocon ol==F & pe mi $display==F &
pe mi $in e .basin==F & pe mi $issued>as.Da e("31 Dec 2019","%d %b %Y")]
xx<-as. ac o (xx)
ou <-da a. ame(names( able(xx)),as.nume ic( able(xx)))
w i e. able(ou ,"a. x ")
117
Money spen
Sugges ed ci a ion: SANBI and CIB 2023. Appendix 4 o "The S a us o Biological In asions and hei
Managemen in Sou h A ica in 2022"—Wo k lows: Money spen . Sou h A ican Na ional
Biodi e si y Ins i u e, Ki s enbosch and DSI-NRF Cen e o Excellence o In asion Biology,
S ellenbosch. h p://dx.doi.o g/10.5281/zenodo.8217222
1. Ra6onale
Using a wo kflow o in eg a e and summa ise he cos o managing biological in asions enables a
anspa en and epea able means o s anda dise he epo `ng o money spen a a ious scales
(local, na`onal, o global). Wi h he de elopmen o he In aCos da abase and many independen
s udies on cos s all using diffe ing app oaches, he adop`on o a wo kflow becomes c ucial o
enhancing da a in eg a`on and acili a`ng meaning ul compa isons (ensu ing FAIR da a p inciples
a e me ). He e, we p esen a wo kflow ha decons uc s he app oach used in he hi d Na`onal
S a us Repo on Biological In asions in Sou h A ica o assess he money spen on biological
in asions in he coun y.
As o ye , code has no been de eloped o au oma e his app oach; howe e a ious unc`ons in he
In aCos package (Le oy e al. 2023) can be used o summa ise cos s.
2. Aim
The wo kflow aims o in eg a e and e alua e cos da a ela ed o managing biological in asions, wi h
a specific emphasis on summa ising expendi u es based on s akeholde s and o h ee p ima y
aspec s o biological in asions (pa hways, species, and si es). He e, we p esen a wo kflow ha
decons uc s he app oach used in he hi d Na`onal S a us Repo on Biological In asions in Sou h
A ica o calcula e he cos o managing biological in asions in he coun y. I aims o ensu e
consis ency and ep oducibili y h oughou he da a manipula`on and analysis s ages, enabling
in o med decision-making and acili a`ng meaning ul compa isons ac oss a ious s udies o da ase s.
3. S uc u e
The wo kflow consis s o fi e p ima y s eps 1) backg ound esea ch; 2) da a collec`on and en y; 3)
da a p ocessing; 4) da a analysis; and 5) summa y and communica`on o esul s. Time will need o
be alloca ed o s eps 1 and 2 as collec`ng and colla`ng da a om official en``es is omen a labo ious
p ocess. Fu he mo e, he e a e mul`ple ins ances whe e cos s will no be made a ailable om
s akeholde s, o whe e he cos s ecei ed a e an incomple e ep esen a`on o he money spen .
S ep 3 equi es some manual da a p ocessing o expand he da a o p epa e i o analysis, bu he
emaining s eps a e ela` ely s aigh o wa d and can be done using excel o exis`ng sc ip in R.
Each p ima y s ep in he wo kflow is b oken down in o smalle s eps o s eamline he p ocess and
inc ease he usabili y o he wo kflow. Whe e needed examples ha e been p o ided in boxes o
cla i y aspec s ha may o he wise p o e difficul o in e p e . Sugges`ons o file names ha e also
been p o ided.
4. S eps
S ep 1: Backg ound esea ch
1.1. Define he scope
a. Clea ly define he geog aphic scope o he s udy– o which a ea you will assess he o al money
spen on managing biological in asions. This maybe local, na`onal, con`nen al, global e c.

118
b. De e mine he `me ame o he assessmen - whe he i conside s a single yea o mul`ple
yea s.
1.2. Iden` y sec o s and s akeholde s
Iden` y he ele an s akeholde s (and any sub-en``es) ha could be in ol ed in managing
biological in asions in he s udy a ea, such as go e nmen agencies and hei ela ed depa men s
and p og ammes, esea ch ins` u`ons, NGOs, indus y associa`ons, p i a e companies, and
in e na`onal o ganisa`ons. This p ocess will highligh some o he p ima y s akeholde s om/ o
which da a will need o be ob ained. In addi`on, his p ocess can help app oxima e he
comple eness o da a ecei ed in e ms o s akeholde ep esen a`on.
S ep 2: Da a collec`on and en y
2.1. Ga he publicly a ailable da a
C ea e a p ima y wo king olde in which all sub olde s and hei ele an files will be sa ed
h oughou he wo kflow, naming he olde [cos _da a]. Iden` y and ga he publicly a ailable da a
sou ces o each s akeholde in ol ed, consul go e nmen epo s, esea ch s udies, p ojec epo s,
and o he sou ces o in o ma`on (published o g ey li e a u e). Wi hin he p ima y wo king olde
c ea e a sub- olde named [open_access_cos _da a] in which you will sa e all indi idual da a sou ces
(files) in hei o iginal o ma (excel, pd , e c.) naming he file [*s akeholde
name*_*yea *_open_access_o iginal].
No e: i is use ul o sa e all files and olde s in lowe case leae s as his can imp o e efficiency when
wo king in R.
2.2. Reques da a om s akeholde s
Engage wi h s akeholde s and expe s o eques addi`onal da a and/o a de ailed b eakdown o he
exis`ng da a. Da a eques s may be made elephonically o h ough official email pa hways using a
clea and concise da a eques leae . Da a eques s can be ailo ed o ensu e da a a e ecei ed in a
p e e ed o ma and ega ding specific poin s o in e es . In his ins ance, i would be use ul o
eques he da a in excel o cs o ma , and whe e possible, o b eakdown expendi u e in o
managemen ype (p o ide examples), and/o as pe he aspec o biological in asions co e ed
(pa hways, species, and si es). Reques ed da a may include budge a y alloca`ons, expendi u es,
g an s, financial eco ds, budge alloca`ons, and/o unding alloca`ons om a ious sou ces. In he
[cos _da a] olde c ea e a sub- olde named [ eques ed_cos _da a] and sa e all ecei ed da a (in
hei o iginal o ma ) as indi idual files named [*s akeholde name*_*yea *_ eques ed_o iginal].
No e: i is likely ha da a will be sen spo adically, as such i is impo an o label all files ca e ully
and consis en ly and o ack o which s akeholde s you do and do no ha e cos da a. Such
in o ma`on can be la e used o highligh any gaps in epo ed expendi u e.
2.3. C ea e a da a empla e
In he [cos _da a] olde c ea e a sub- olde named [da a_en y]. C ea e an emp y excel sp eadshee
o da a en y (see Table 1 o he name and numbe o columns o be used) and sa e he file as
[da a_en y_ empla e] in he [da a_en y] sub- olde .
2.4 En e he aw da a
Fo each o he o iginal da ase s ob ained pe s akeholde in he olde s [ eques ed_cos _da a_ aw]
and [open_access_cos _da a_ aw] popula e he da a_en y_ empla e (see Table 1 o me ada a)
c ea`ng one excel file pe s akeholde . Sa e each indi idual da a file wi h he co esponding name
[*s akeholde name*_ aw] in he [da a_en y] sub- olde .
119
No e: i is impo an ha he da a ecei ed pe s akeholde is en e ed in o and sa ed as an indi idual
da a file as he da a will la e be expanded. Pe o ming his ac`on in a consolida ed da a file (i.e., all
ecei ed da a en e ed in o a single file) can p o e o be `me consuming and difficul o ack.
120
Table 1. Da a en y empla e indica`ng he columns and hei associa ed a iables, desc ip o s, and me ada a. I he da a ecei ed is no specific o he
desc ip o s ou lined, he use o ‘unspecified’ as a desc ip o o ha a iable is sugges ed (i.e., i he da a p o ided does no speci y managemen ype one
would use he desc ip o ‘unspecified’ in ha column). Whe e mul`ple desc ip o s apply o a single a iable pipe delimi e s should be used wi hou spacing
(e.g., managemen Type could be en e ed o a single cos en y as mechanical|chemical| esea ch). No e he desc ip o ‘ a ious’ only applies o species as
such lis s may p o e oo leng hy o popula e a single cell).
Pu pose Va iable Name Column
numbe
Va iable
ype
Desc ip o me ada a - Desc ip6on
Cos
iden`fie
s akeholde Name
1
Desc ip` e
The name o he s akeholde o he
cos en y
sec o Type 2 Ca ego ical go e nmen - a public en` y ha is owned and con olled by he s a e o i s ep esen a` es
p i a e – p i a e landowne s, businesses, and o ganisa`ons wi h ull au onomy in owne ship and decision-making
sou ceName 3 Desc ip` e The name o he sou ce: can ei he be he same as he s akeholde name o a e e ence e.g., Noel e al. (2020)
Cos
es`ma e
awCos Yea 4 Nume ic The applicable yea o `mespan (e.g., 2020 – 2022) o he epo ed cos
awCos 5 Nume ic Cos es`ma e di ec ly ecei ed om he s akeholde o sou ce
cos S anda dised 6 Nume ic The awCos adjus ed o infla`on o eflec he baseline yea chosen o epo `ng
Cos ype managemen Type 7 Ca ego ical mechanical - using physical me hods o emo e o con ol in asi e species
chemical - using chemical ea men s o con ol in asi e species
biological - in oducing na u al enemies o biological con ol agen s o con ol o egula e popula`ons
biosecu i y - p e en a` e measu es, his includes bo de con ol and qua an`ne p o ocols, e c.
in eg a ed – one o mo e o he app oached combined
esea ch – all esea ch pe aining o biological in asions
ou each – public educa`on and awa eness aising
o e heads – sala ies e c.
indica o Type 8 Ca ego ical lumpSum – he cos ecei ed is a a cou se esolu`on wi h no b eakdown on pa hways/ species/ si es
speciesBased – he cos ecei ed a e o can be b oken down in o species specific cos s
si esBased – a e o can be b oken down in o si e (a ea) specific cos s
pa hwaysBased – a e o can be b oken down in o pa hway specific cos s
Pa hways
b eakdown
pa hwayCa ego y
9
Ca ego ical
elease – con ol effo s ocus on mi`ga`ng in asions in oduced ia pa hways associa ed wi h pu pose ul elease in o na u e – legisla`on???
escape – effo s ocus on in asions ha ha e escaped om confinemen e.g., legisla`on o aded/ b ed species
con aminan – effo s ocus on p e en`ng/ educing in oduc`ons o species as con aminan s e.g., bo de con ol
s owaway - effo s ocus on p e en`ng/ educing in oduc`ons o species as s owaways e.g., biosecu i y
Species
b eakdown
speciesName 10 Desc ip` e The ull species name: Genus species, o a ious (whe e a lump sum is p o ided o a lis o species)
kingdom
11
Desc ip` e
Plan ae, Animalia, Fungi, P o`s a, Mone a
amily 12 Desc ip` e Taxonomic amily o he associa ed cos en y
genus
13
Desc ip` e
Taxonomic genus o he associa ed cos en y
Si es
b eakdown
p o ince 14 Desc ip` e Desc ip` e - The e a e 9 p o inces in Sou h A ica, include he p o ince(s) o which he cos pe ains. Equi alen o ‘s a e’ in o he coun ies
municipali y
15
Desc ip` e
Desc ip` e
–
The e a e 205 local municipali`es in Sou h A ica lis he municipali y(ies) associa ed wi h he cos
landType 16 Ca ego ical p o ec edA ea - a eas ha a e managed and legally p o ec ed o conse e and p ese e hei na u al, ecological, and cul u al alues
p i a eLand - and ha is owned by indi iduals, o ganiza`ons, o en``es, a he han being owned by he go e nmen o held in public us
s a eOwned – land held in he public domain ha is owned and managed by he go e nmen a he na`onal, egional, o local le el.
communalLand - land ha is owned and managed collec` ely by a communi y o a g oup o people who ha e cus oma y o adi`onal igh s
o he – he land- ype associa ed wi h he cos en y does no fi in o he abo e lis ed ca ego ies.
121
S ep 3: Da a p ocessing
3.1. Expand he da a ( o eflec a single applicable yea pe cos en y)
Fo each indi idual aw cos da ase examine i he da a need expansion by conside ing he column
awCos Yea (column 4; see Table 1). Fo da a en ies whe e he cos da a eflec s a `mespan (e.g.,
2020-2022) i is necessa y o expand he da a o ensu e one ow o da a exp esses a singula cos o
a single yea . No e: no all da a will equi e expansion - i he da a p o ided al eady eflec s a single
yea hen no expansion is equi ed and he ow o da a should be e ained as is.
Expand pe yea p ocess: Wi hin each aw da ase iden` y any cos en y (i.e., ow o da a) ha
indica es a singula cos o a `me ange (e.g., 2020 – 2021; spanning 2 yea s). To analyse he da a,
his cos needs o be pa sed ou o eflec a single cos pe single yea . A new blank ow needs o be
added pe yea o he `me ame (e.g., 2 new blank ows o a 2-yea `mespan - one o 2020 and
one o 2021). The o al cos o he `mespan should now be di ided by he numbe o yea s
indica ed in he aw da a (e.g., by wo) and en e ed in o he new ows pe yea (e.g., 1 million spen
om 2020–2021 would be e-en e ed as 500 000 o 2020, and 500 000 o 2021) – see Box 1 o
de ailed examples. All o he suppo `ng in o ma`on (i.e., species name, land use ype, managemen
ype, e c.) should be copied in o he ele an cells pe expanded en y and should no change. I is
e y impo an ha newly expanded files be sa ed sepa a ely o he aw da a files, and he file
app op ia ely named [*s akeholde name*_expanded].
No e: Al hough his assumes equal spending pe yea i allows o he assessmen o empo al
ends.
Box 1. An example ( ocussing on selec ed columns) o he da a expansion p ocess o achie e one ow
o da a pe cos pe yea . Please no e he use o pipe-delimi e s o ca ego ical a iables wi h mo e
han one desc ip o .
Raw da a base example
s akeholde Name
awCos
Yea
Managemen ype
species
landType
Depa men o
na u e
4
000
000
2020
-
2021
Biological|Chemical
Species A|Species
p o ec ed
In asion bus e s co.
1
000 000
2021
Mechanical
Species A|Species B
p i a e|o he
Expanded da abase example
s akeholde Name
awCos
Yea
Managemen ype
species
landType
Depa men o na u e
2 000 000
2020
Biological|Chemical
Species A|Species B
p o ec ed
Depa men o na u e
2 000 000
2021
Biological|Chemical
Species A|Species B
p o ec ed
In asion bus e s co.
1
000 000
2021
Mechanical
Species A|Species B
p i a e|o he
3.2. Me ge da a in o a single da ase
C ea e a new blank da a empla e as pe ‘S ep 2.3’. En e in o his empla e all he da a om each
expanded da a file. This p ocess should be ela` ely simple as he empla e design and me ada a
should be exac ly ma ched ac oss all indi idual expanded da ase s ha ha e been c ea ed pe
s akeholde . No e: i copying and pas`ng he da a om one file o ano he , ensu e o pas e as alues
so ha no in o ma`on is los . Sa e he new file in he [cos _da a] olde naming he file
[all_cos s_me ged].
3.3. S anda dise he aw cos o a baseline yea
S anda dising cos s o a baseline yea imp o es he compa abili y o esul s o e `me and b ings all
cos da a o a baseline o imp o e he accu acy o he analysis. To s anda dise all ecei ed cos s o a
single baseline yea , adjus he da a o infla`on. Fo example, i he chosen baseline yea is 2021 and
- Abundance: Plan s: le Roux e al. (2013), le Roux and G e e unpublished da a (collec ed
be ween 2018-2020).
In e eb a es ( o Figu es 5.5 and 5.6): no o al abundance es ima es, bu
numbe o indi iduals o pe m2 o km2 we e ob ained om:
Gab iel e al. (2001): abundance da a on i e sp ing ail (Collembola) species cu en ly
p esen on Ma ion Island (Ce a ophysella den icula a, Iso omu us macula us, Megalo ho ax
minimus, Pa iso oma no abilis and Pogonogna hellus la escens), ou o six species (one
species cu en ly absen , he e o e no da a)
Ba endse e al. (2002): abundance da a on h ee axa o mi es (Cillibidae, Dend olaelaps and
Pygmepho idae = Bake dania) ou o se en axa p esen on Ma ion Island.
Hugo e al. (2006) o PEI mic oa h opods: wo c yp ogenic mi e axa (Cillibidae and
Dend olaelaps), and i e sp ing ail (Collembola) species
Mice: McLelland e al. (2018) p esen s da a on mouse densi y h ough li e
apping and de ails on sex, b eeding s a us, age (ju enile o subadul /adul ). These da a
we e he mos up o da e es ima es as o May 2023 ( acco ding o expe An on Wol aa d ).
Species lis
The species lis o he PEIs ollows ins uc ions in he PEIs me ada a o de e mine possible alues in
each column. The PEIs me ada a is di e en om he mainland one, as o example di e en ealms
apply.
The i s d a o he PEIs’ species lis was de eloped ollowing G e e e . al. (2017). Addi ional axa
we e added om a numbe o di e en da a sou ces by scou ing he li e a u e. G e e e al. (2017)
did no ha e a comp ehensi e lis o species ha we e eco ded only once; he e o e, mos species
added we e species ha we e ansien . E.g. 14 axa we e added om Wa kins and Coope (1986)
and he lis was compa ed wi h Pagad (2020) (PEIs species lis om GBIF), bu all eco ds we e
p esen al eady in he epo ’s lis . Finally, he lis was compa ed o ha om Leihy e . al. (2023),
and h ee mo e axa we e added (As emolaelaps, Bla ella ge manica, and Passe domes icus). This
las sou ce also has in o ma ion on occu ence, e adica ion, in oduc ion s a us, i s da e obse ed
and es ima ed da e o in oduc ion.
● Fo species o which occu ences a us=doub ul o c yp ogenic, deg eeO Es ablishmen and
in oduc ionS a us will be NA, oge he wi h con idence and sou ce. The in o ma ion
ega ding wha deg ee o es ablishmen a axon eached while p esen will be e lec ed in
he his o yO In asion column (las column), which is only p esen in he PEIs species lis (no
mainland).
● I a axon appea s in he bibliog aphy as ‘ ansien ’ o ‘no es ablished’, hen i is conside ed
as ‘absen ’ in he ‘occu enceS a us’ column.
Pa hways
Fo each species, he li e a u e was exhaus i ely sea ched o in o ma ion on he mode o
in oduc ion.
G e e e al. (2017) had some in o ma ion on pa hways, bu o se e al species, pa hway in o ma ion
was ai ly unspeci ic. E.g. many species a e hough o ha e been in oduced acciden ally as

con aminan , bu he li e a u e was unclea abou wha he suspec ed con aminan was. The e o e,
o many species, he pa hway could no be de e mined, and has been ca ego ised as ‘unknown’.
E ec i eness in managing in asions
A ‘Fi s pa y assessmen ’ is pe o med by he ECOs ( hey assess hei own wo k), and hey p oduce
one epo e e y yea whe e hey epo on hei managemen ac ions and indings.
Then, a ‘Second pa y assessmen ’ occu s e e y h ee yea s o pe o m quali y assu ance: a DFFE
membe goes o he island and checks ha e e y hing is p ope ly used/done. This assessmen
in ol es ield assessmen s and checking ECOs' epo s.
Money spen
A budge was p o ided by Debbie Mui wi h expenses on he bicide, pes icide and pe sonal
p o ec i e equipmen (PPE). Howe e , he ime in es ed by he ECOs on managing in asi e species
has no been included in he calcula ions o money spen , as he e was no in o ma ion p o ided on
ei he he sala y o he ECOs o how many hou s pe mon h o yea hey in es in con olling
in asi e axa.