{'fraction_non_alphanumeric': 0.034185599316288014, 'fraction_numerical': 0.016974099660518008, 'mean_word_length': 4.965727234102818, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Interplay of trade and food system resilience: Gains on supply diversity over time at the cost of trade independency

Rapidly increasing international food trade has drastically altered the global food system over the past decades. Using national scale indicators, we assess two of the resilience principles that directly reflect the effects of global trade on food systems – namely, maintaining diversity and redundancy, and managing connectivity. We perform our analysis for four nutritional components: dietary energy, proteins, fat, and quantity of vegetables & fruits – the key pillars of the WHO dietary recommendations. Our results indicate that, between 1987 and 2013, food supply diversity increased significantly for most of the world's population at the cost of an elevated dependency upon food imports. Food production diversity, particularly in terms of dietary energy and vegetables & fruits, increased for a large proportion of the world population, with the exception being major exporting countries, where it decreased. Of particular note is our finding that, despite a growing number of people being heavily dependent upon imports, the number of import partners decreased more often than it increased, except for the case of vegetables & fruits. This combination of increased dependency on imports and a reduced number of import partners indicates a potential vulnerability to disruptions in linked food systems. Additionally, it is alarming that we found many countries where the studied resilience aspects systematically declined, elevating their exposure to future shocks in the food system.


Introduction
Rapid globalisation has led to increasingly connected food systems (Porkka et al., 2013;Gephart et al., 2016;Cottrell et al., 2019). Trade of agricultural and fishery products has increased dramatically over the past decades (D'Odorico et al., 2014;WITS, 2017;FAO, 2018b); for example, the value of annual food exports has increased from 13 to 620 billion USD since 1988 (WITS, 2017), and today about one quarter of the food produced for human consumption is traded internationally (D'Odorico et al., 2014). For seafood, the FAO estimated that approximately 35 percent of global fish production entered international trade. This has led to a situation where the vast majority of the world's population (approximately 80%) lives in countries that are at least partially dependent on foodstuff imports to fulfil their food demand (Porkka et al., 2013).
At the same time, frequency of food shocks has increased and Cottrell et al. (2019) found that this was associated with an increasing number of conflicts and extreme-weather events. This highlights the growing importance of ensuring resilient food landscapes that are able to navigate and persist in the face of these uncertain conditions. In general terms, resilience is the ability to respond, reorganize and adapt to disruptions while retaining essentially the same function, structure, identity and feedbacks throughout the change (Folke et al., 2010;Schipanski et al., 2016). Limited ability to respond and adapt to food systems' disruptions, i.e. low resilience, can cause food shortages and fluctuations in food prices to varying degrees of intensity and duration (Schipanski et al., 2016;Gephart et al., 2017).
Trade is one of many strategies available for buffering against these disruptions; other strategies include alternative food sources, backup distribution, or emergency supplies (Schipanski et al., 2016). Global https://doi.org/10.1016/j.gfs.2020.100360 Received 25 May 2019; Received in revised form 30 November 2019; Accepted 3 February 2020 food trade has enabled many regions to secure food supply and overcome local limits of growth set by scarce natural resources or less developed farming practices  as well as reduce pressure on natural resources such as water on a global scale (Yang et al., 2006;Liu et al., 2018). Trade can also contribute to increase the diversity of food supply in a particular country or region (Thow, 2009;Thow and Hawkes, 2009;Kearney, 2010) and can therefore ensure the resilience of a food system in times of crisis or whenever the local conditions are too adverse .
At the same time, trade in combination with the outcomes of the green revolution, has contributed to the specialisation and intensification of local food systems across the world with the single target of maximizing yields. As a consequence, diversity in local food production landscapes has substantially decreased and diverse and nutritious landscapes have been progressively replaced by monocultures with low resilience to respond to unanticipated shocks (D'Odorico et al., 2010;Thow et al., 2011;Puma et al., 2015;Suweis et al., 2015;Davis et al., 2016). Additionally, through global trade, food systems are becoming increasingly interconnected and interdependent, meaning that disturbances and drivers in one place can cause synchronous shocks across other regions and sectors (Buldyrev et al., 2010;Sternberg, 2012;D'Odorico et al., 2014;Suweis et al., 2015;Gephart et al., 2017;Cottrell et al., 2019). Trade has also contributed to the decoupling of food supply and production and the displacement of environmental and social impacts of food consumption. Addittionally in some cases local diets with high nutritional diversity have been outcompeted by globalised nutritionally poor diets, with the additional loss of cultural values and traditions associated with these (Morgan et al., 2006). Further, globalisation of food systems has led to the export of domestic products to international markets with higher prices reducing local access to food  as well as overexploitation of local resources (Dalin et al., 2017).
Thus, trade may mask or dilute feedback signals about the state of production systems and in that way contribute for consumers unawareness on the impacts of the production of different food items (Deutsch et al., 2011;Crona et al., 2015). This double role of trade as a promoter and eroder of food system resilience is context and scale dependent, and still poorly understood. Further research that disentangles this complexity by monitoring the impacts of global food trade at different spatial and time scales is therefore crucial.
Here we provide a first step towards understanding how international food trade impacts on a set of food system resilience variables and how these have changed over the last three decades. Our analysis is based on two resilience principles (RPs) from Biggs et al. (2012) that most closely reflect the effects of trade on food systems -namely, maintaining diversity and redundancy (RP1) and managing connectivity (RP2). Diverse systems that have many different complementary components from multiple sources are generally more resilient than systems with few components, allowing systems to compensate for the loss or failure of some components with other functionally redundant components (Elmqvist et al., 2003;Folke, 2006). Managing connectivity is also crucial for food system resilience. Well-connected food systems can overcome and recover from disturbances faster by "importing" sources of resilience, such as food products, agricultural/aquaculture inputs, knowledge, financial resources, and workforce, from elsewhere. On the other hand, overly connected systems -aspect that is not captured in this study -may lead to the rapid spread of disturbances and unintended impacts across the entire food system (Biggs et al., 2012;Biggs et al., 2015).

Data and methods
We focused on the national scale and used FAOSTAT Food Balance Sheets and trade data (FAO, 2018a) to construct two indicators for each of the two resilience principles that can be calculated for the majority of countries over the past three decades: diversity of food production of different commodities (RP1a), and diversity of food supply of different commodities from both local and imported sources (RP1b); independency of food supply from imports (RP2a), and connectivity given by the number of major trade partners (RP2b).
Indicators were defined so that the higher the indicator value, the more positive impact it has on resilience. All the indicators were calculated for four nutritional components: dietary energy (kcal), protein (g), fat (g), and quantity of vegetables & fruits (g). These components provide different nutritional functions and are the basic pillars of WHO diet recommendations (WHO, 2003). The main manuscript primarily focuses on proteins and vegetables & fruits, while the results for all four nutritional components are shown in the Supplement. For summary figures and results, the findings for all nutritional components are shown.
Our indicators capture trade-related aspects of national food supply, which is one aspect of food system resilience, but by no means the only one. Our focus here is specifically on the globalised food system and its ability to provide food in the face of disruptions across the world. Our index, however, does not indicate whether food supply is actually sufficient (Porkka et al., 2013), or whether there is potential to increase local production , as these are already covered in referred studies among others. Food system resilience is also dependent on landscape and crop diversity, other local production specific aspects (i.e. access to irrigation systems and storage facilities) and socio-economic aspects, such as ability to pay for food etc. However, most of these aspects are beyond the scope of this study. Although we included diversity of food produced as an indicator in this study (and higher diversity of production could be a rough indicator of more diverse landscapes), the national level is too coarse to capture whether this is actually reflected on resilience at the landscape level.
Moreover, it is important to note that our indicators do not capture the full complexity of managing connectivity; in that we do not assess whether a system can be overly connected. However, we argue that using our two connectivity indicators (independency from trade and number of import connections) in combination covers a lot of that complexity and can help to assess the effect of managing connectivity on food system resilience. A high number of trade partners can often be assumed to have a positive effect on resilience, as trade partners in one part of the world can buffer against potential food system disruptions in other parts of the world. That said, these positive effects can be outpaced by the negative impacts of increased dependency on imports, making food supply in trade-dependent countries susceptible to shocks originating in various parts of the trade network. Countries with high dependency on imports from only a few major trading partners are arguably in an even more vulnerable position, as any shocks that impact those partners are likely to reduce imports upon which the country relies. Table 1 provides an overview of the indicators used here to assess the impacts of trade on food supply resilience. Diverse production of foodstuff (in terms of nutritional components) (RP1a) is considered to positively affect stability and resilience in agricultural ecosystems (Cabell and Oelofse, 2012;Khoury et al., 2014) and this indicator is therefore assumed to contribute positively to resilience. Diverse supply of both locally produced and imported foodstuffs (RP1b), in turn, has been reported to increase nutritional adequacy and food security (Ruel, 2003;Graham et al., 2007;Remans et al., 2014;Stein, 2018), and thus as well contribute positively to resilience.

Indicators
When considering the connectivity indicators, independency from imports (RP2a) would enhance the resilience to any disruptions in the trade network, such as production shocks in exporting countries, price spikes and export bans (Marchand et al., 2016;Cottrell et al., 2019). In self-sufficient countries with no surplus production, impact on resilience is considered neutral, for although reliance on imports is low, local production shocks can have a drastic impact on food availability. Production surplus is considered to have a positive impact on food system resilience, as it could buffer against shocks in local production. Regarding the number of trade partners (RP2b), if a country relies on only a few sources of food imports, shocks in those places could have a significant impact on food availability. On the other hand, a more diverse trade network would be able to buffer a shock occurring in one or several of the exporting countries (Marchand et al., 2016). Thus, we consider higher number of import connections to have a positive impact on food system resilience.

Calculation of the indicators 2.2.1. Data sources
Input data for the analysis are from the FAOSTAT Food Balance Sheets and detailed trade matrix (FAO, 2018a). Our study period covers the years from 1987 to 2013 -which are those with full temporal coverage of both FAOSTAT food balance data and FAOSTAT trade data. Data transformations and filling of data gaps are described below. FAOSTAT trade data includes some data gaps. The missing years between available data were estimated using linear interpolation. The missing values, at either the beginning or end of the time series, were filled with the closest available existing value.

Data transformations
The FAOSTAT food balance data were converted from mass to dietary energy (kcal), fat (g), and protein (g) using product-, country-, and year-specific conversion factors (based on FAOSTAT Food Balance Sheets). For vegetables & fruits, the weight (g) of these two food item groups were used. To account for the short-term interannual fluctuation in the data, all Food Balance Sheet values were averaged over three years. Spices, non-food items, and alcohol were excluded from the analysis.
The vegetal and processed livestock items from FAOSTAT detailed trade matrix were transformed to energy and nutritional components using FAOSTAT Food Balance Sheet data for the given "parent" product, for example, the nutritional component contents for cattle meat were derived from "Bovine Meat" values for the reporting country. As the live animals were reported as head counts, we transformed the number of animals first to approximate weights applying country-, animal-and year-specific yields per animal and then to kilocalories, grams of proteins and grams of fats using Food Balance Sheets nutritional component contents for the corresponding parent product (FAO, 2018a). The trade statistics do not specify the purpose of the traded live animals, for example, they could be used for meat or milk production. We assumed that once the animals are imported to a country, they will be slaughtered for food production at the end of their life cycle, thus counting all of the imported live animals as meat.
Some of the countries in our analysis underwent changes in the political regime, such as the dissolution of countries (e.g., Soviet Union). To fill the data gaps resulting from these changes, we used a similar approach as Porkka et al. (2013), where the data from the "parent country" is used as a proxy. For the diversity indicators, nutritional component contents of the food items were kept equal to the proxy country. For food supply variables such as production quantity, the data for given proxy country was divided among the corresponding present-day countries relative to their shares of the countries' combined value on the earliest available year (e.g. former Soviet Union countries after the dissolution in 1991). The relative values for the food supply variables remained equal throughout the proxy period. For the trade dependency indicator, the dependency value (share of net imports of food supply) from the "parent country" was assigned to all corresponding present-day countries.

Production and supply diversity
Production and food supply diversity were assessed using a similar Table 1 List of indicators, their definition and how they are calculated. All indicators are defined in a way that the higher the indicator, the more positive impact on the resilience. RP1 and RP2 refer to resilience principles (RPs) maintaining diversity and redundancy and managing connectivity, respectively, after Biggs et al. (2012). All the indicators were calculated for four nutritional components: dietary energy (kcal), protein (g), fat (g), and quantity of vegetables & fruits (g).
Food production diversity (RP1a) Food supply diversity (RP1b) Independency from food imports (RP2a) Import connections (RP2b) Definition Diversity of the production of different foodstuff commodities (i.e. FAO food items) in terms of nutritional components.
The indicator thus displays how many different types of food items are produced within a given country and how equally they are distributed in terms of the assessed nutritional components.
Diversity of the supply of different foodstuff commodities (i.e. FAO food items) in terms of nutritional components.
The indicator indicates how many different types of food items are supplied within a given country (from both local and imported sources) and how equally they are distributed in terms of the four nutritional components they provide.
Independency of a country's total food supply from imports, in terms of nutritional components.
We estimate it here as the share of domestic production of the entire supply of a given nutritional component in a given year.
Number of countries from which food is imported in significant quantities measured as trade flows in terms of nutritional components. Countries with few dominant food import partners usually receive a low value whereas countries with many equally sized partners receive a higher value.
Calculations Food production diversity is calculated with Shannon diversity index. Scaled between 0 and 1, using values for 2.5 and 97.5 percentiles globally over the study period 1986-2013.
Food supply diversity is calculated with Shannon diversity index. Scaled between 0 and 1, using values for 2.5 and 97.5 percentiles globally over the study period 1986-2013.
Scaled between 0 and 1 so that 0 represents a case when supply of nutritional components is fully dependent on imports, 0.5 means self-sufficiency with no production surplus while 1 represents high net-exports (net exports are equal or more than national food supply) Diversity of import connections is estimated using effective number of species (ENS) from Shannon diversity index. Indicator is scaled between 0 and 1, using values for 2.5 and 97.5 percentiles globally over the study period 1986-2013.
approach as Remans et al. (2014), where the Shannon index (Shannon, 1948) was used as a diversity metric. The Shannon index displays how many different types of food items are produced or supplied within a given country, and how equal their distribution is. Countries with only a few dominant food items usually receive a low value, whereas countries with many equally sized groups receive a higher Shannon index. For each country, the Shannon index, H' is calculated as follows: where s i is the proportion of a given food item i of the total food supply, both measured in terms of nutritional components (e.g. grams of protein). Term n denotes the number of items in a given country.

Independency from trade
Here, trade independency denotes the share of local production of the entire human food supply in a given year, such that trade independency = 1 in self sufficient countries, < 1 in net importing countries and > 1 in net exporting countries. Following Porkka et al. (2013), we consider net imports of food as available for direct human consumption, and any other uses of the domestic supply of commodities (such as for feed, processing, reserves or food losses) originating from domestic sources. Some of the imports are, however, also used for these purposes but due to the nature of FAOSTAT data, it was not feasible to estimate domestically produced and imported shares reliably. Such dependency on imported inputs is still implicitly considered in our indicator. For instance, for countries such as the Netherlands, that import large amounts of cereals and soybeans for animal feed and other uses, independency from trade (before scaling, see Section 2.3) can be < 0, as they would not be able to sustain the level of domestic food production without significant inputs from elsewhere, and potential calories/proteins/fats for human consumption are lost in the process.

Diversity of import connections
Import connections were obtained from FAOSTAT detailed trade matrix by calculating the imports from each partner for each reporting country. We then estimated how diverse the network of import partners is using a method that is used to estimate the effective number of species (ENS)

ENS = exp(H′)
( 2) where H′ is the Shannon diversity index (see Eq. (1)) of imports for a given country. Here, the term s i of Eq. (1) is the sum of imports from country i as a share of total imports, both calculated in terms of nutritional components (e.g. grams of protein). Therefore, countries with few dominant import partners would receive a low indicator value whereas countries with many equally sized partners would receive a higher value.

Normalising indicators and estimating trends
We first calculated the average of each indicator over three-year time steps for the entire study period (i.e. 1987-1989, 1990-1992, …, 2011-2013). After that, we normalised the diversity and import connections indicators between 0 and 1 using 2.5 and 97.5 percentiles in order to remove possible outliers. In all indicators, 0 represents the lowest resilience and 1 the highest resilience. Independency from trade was scaled, instead of being normalised, so that self-sufficient countries with no production surplus (i.e. no net exports) received the value 0.5, countries that exported (net) at least the same amount of food as their food supply received the value 1, while countries fully dependent on imports (net imports are equal or greater than food supply) were assigned the value 0.
By using these normalised three-year steps, we were able to assess how the indicators have changed over the study period. To estimate the rate of change, we used a linear regression model, and the significance of trend change was tested with a non-parametric Spearman test (trend.test package in R), bootstrapped over 1000 steps. Thus, it should be noted that the trend did not need to be linear for statistical significance.

Calculation of the overall performance and direction of change
We performed two analyses to summarise the findings of the four resilience indicators, each calculated individually for the nutritional components. First, we calculated a 'rank index' where the countries were initially assigned a value based on which percentile bracket it falls within for the indicator-nutritional component combination in question. If a country was within the worst 20th percentile, it was assigned the value 0.2, between 20th and 40th percentile it was assigned the value 0.4, and so forth. These values were then summed to form a rank index between 3.2 and 16. For the second summary index, called 'direction of change', countries were assigned values for each indicatornutritional component combination as follows: −1 for a statistically significant negative trend stronger than −0.1, −0.5 for a statistically significant negative trend smaller or equal than −0.1, 0 for no significant trend, +0.5 for a significant positive trend smaller or equal than 0.1, and +1 for a significant positive trend stronger than 0.1. These values were then summed to form an index ranging from −16 to 16.

Clustering
Finally, we clustered the countries with k-means clustering (MacQueen, 1967) for each of the nutritional components, using two different sets of data: i) indicator values for the last time step (2011)(2012)(2013), and ii) rate of change of each indicator over the study period. The clustering based on indicator values was done using the individual indicators, thus revealing the mix of aspects in the rank index of these countries. The clustering based on the change in indicator values, in turn, was done by using the rate of change estimated with a linear regression model (see above), and thus indicates the pathway each country has taken over the study period. As each indicator was normalised and scaled for range 0-1, no separate scaling was needed for clustering. The number of meaningful clusters was determined using the 'nbclust' package in R (Charrad et al., 2014).

Food supply diversity increased at the cost of increased trade dependency
Our findings revealed strong heterogeneity among the assessed indicators and nutritional components, as well as changes in those over time (1987-1989 vs 2011-2013) (Figs. 1 and 2, Figs. S1-S4). The food production diversity (RP1a) of proteins decreased in major food exporting countries (countries with negative values in Fig. 1C and high values in Fig. 2B), such as Argentina, Brazil, United States, Australia and the former Soviet Union countries. This could indicate exportdriven specialisation in certain protein-dense food products in these countries. Whereas the food production diversity of proteins increased in China and the Middle East (Fig. 1C). At the latest time step, the production diversity of proteins was highest in South and East Asia, Africa, and northern parts of South America, as well as individual countries in Europe (Fig. 1B). In terms of vegetables & fruits, the pattern is somewhat different, and the most notable changes occurred in large parts of Asia, Northern Africa and South America, where production diversity increased significantly (Fig. 1F). In recent years, the diversity of vegetables was largest throughout the Americas and in the Mediterranean, as well as South Asia and Australia (Fig. 1E).
Food supply diversity (RP1b) has increased for a majority of the  M. Kummu, et al. Global Food Security 24 (2020) 100360 global population and a majority of countries (5.4 billion in terms of proteins and 5.7 billion in terms of vegetables & fruits, living in 101 and 100 countries respectively; see Fig. 3B). The highest increase for both proteins and vegetables & fruits can be seen in Asia, Southern and Northern Africa, parts of the Middle East, and Europe (Fig. 1I, L). The opposite trend is only observable in individual countries, and even then the decrease is not substantial. This leads to a situation where supply diversity is, at the last time step, highest in the Americas, parts of Europe and Africa, and Australia, as well as selected countries across other regions (Fig. 1H,K).
Our results indicate that the high increase in food supply diversity has not come without a cost: for a majority of the population, dependency on food imports (RP2a) has increased over the study period (i.e. negative trend in Fig. 2C, F and Fig. 3C). Only a few countries, such as Paraguay, Brazil, Namibia and former Soviet Union countries, were able to strongly increase their independency in terms of proteins (Fig. 2C), and Argentina, Namibia, South Africa and Spain in terms of vegetables & fruits (Fig. 2F). This has led to a situation where a large part of the world population lives in countries that are dependent on imports (independency from imports -indicator value less than 0.5 in Fig. 1B,E). It is notable that major net exporters of protein tend to be different from those that have high net exports of vegetables & fruits (large values in Fig. 1B,E), which again implies potential export-driven specialisation.
As diminishing independency from imports (i.e. increased dependency on imports) might imply, for proteins, the number of import partners (RP2b) increased significantly in 88 countries, accounting for 31% of the world population. Interestingly, however, an even larger share of the global population (33%) live in one of the 36 countries where the number of import partners decreased (Fig. 3D). In terms of vegetables & fruits, import partners increased in 79 countries, accounting for a slightly larger share of the population (44%) than the 45 countries where the number of import partners decreased (40% of the population). The spatial pattern is similar for both proteins and vegetables & fruits, showing a low number of import partners in parts of Americas and Asia, as well as parts of Africa, while high numbers of partners are in Europe, the Middle East, and Australia (Fig. 2H,K). Countries that are highly import-dependent (low values in Fig. 2B) and have a low number of import partners (low values in Fig. 2H), such as Mexico, Colombia, Venezuela, China and Japan, are likely to be vulnerable to shocks in the trade network.

In a majority of countries more resilience indicators have increased than decreased
For a substantial number of countries (n = 96, see Fig. 4B) that constitute more than half of the world population in 2013 (3.6 billion), more indicator-nutritional component combinations (n = 16) increased  than decreased (i.e. the change count index value is positive). However, the converse is true for 1.6 billion people living in 53 countries (Fig. 4B). The decreasing trend is evident in countries such as Thailand (change count = −6), United States (−7), Sweden (−7.5), and Afghanistan (−9) (see Fig. 5B; only countries with more than 500′000 inhabitants included). The most notable increase in resilience indicators has taken place in Eastern Europe, parts of South and Western Africa, South Asia, the Middle East, and in Brazil, with the top countries being Namibia (+11.5) and Malawi (+10.5) (see top six countries in Fig. 5B). While strong regional patterns are visible in Fig. 4B, opposing trends can also be seen within regions. For example, in the Middle East, Afghanistan is the only country with a strong decrease in many of the indicators, whereas Botswana and Madagascar are similar kinds of outliers in southern Africa.
When ranking the countries over the assessed indicator-nutritional component combinations, the highest scores were found in Tanzania (13.4), and three Mediterranean countries: Spain (14.2), Greece (13.4), and Italy (13.4). The lowest score, was found in Djibouti (5.2), closely followed by Afghanistan (5.6), and Mongolia (5.6) (see Fig. 5A; only countries with more than 500′000 inhabitants included). The highest resilience values can be found in Western and Central Europe, Australia, the United States, and parts of Africa; with the latter having very high heterogeneity (Fig. 4A).

Countries' resilience is composed in very different ways
When clustering countries based on the individual indicators (see Table 1), we can explore how different aspects of resilience are highlighted in different countries (Fig. 6A for proteins, Fig. 6C for vegetables & fruits), and the characteristic pathways countries have taken over the past decades ( Fig. 6B for proteins, Fig. 6D for vegetables & fruits).
In the case of proteins, Cluster B shows high or very high values for all assessed indicators, including countries such as Russia and Australia (Fig. 6A). In contrast, Cluster E has relatively low value across all indicators, including countries such as Mongolia, Afghanistan and Madagascar. Large exporting countries with medium values in diversity indicators and low value in import partners, such as the United States, Brazil, Ukraine, and Argentina belong to Cluster F. High food production and supply diversity values can be found in Cluster A countries (Middle East, a large part of Europe); however, these are dependent on imports to fulfil their food supply. Countries in Cluster C (China, India, Central America) also have high food production and supply diversity values, and are somewhat dependent on imports, but only from very few sources -potentially making them vulnerable to any shocks in their sparse network.
The clusters formed in the case of vegetables & fruits are very differently when compared to those formed for proteins (Fig. 6A,C). In Cluster B, all the indicators score high or very high, including regions such as Australia, South America as well as some Mediterranean countries. By contrast, scores in cluster E were low or very low, mostly pertaining to East Asian and some African countries. Clusters C and F have similar patterns, each having high production and supply diversity, as well as independency from imports, but rely on a low number of import partners. Cluster C covers almost the entire Americas as well as some Mediterranean countries, while Cluster F consists of Indonesia, India and a few countries in Africa. Clusters A and D also have similar indicator patterns, both having very high supply diversity, but also a high dependency on imports. However, Cluster D countries differ slightly as they rely on fewer trade partners and produce a more diverse array of local vegetables & fruits. These clusters include countries such as Northern Europe and Russia (A), and Central Europe, Canada, and Japan (D).
When assessing change in indicators over time, in terms of proteins, clusters J and L show similar patterns for each of the indicators, varying only in the intensity of the change (Fig. 6B). In these clusters, all but the production diversity indicator display a positive trend. These clusters include countries such as Russia, Ukraine, and Brazil, where independency from imports has increased strongly, while the size of their 'support network' of import partners has also increased. However, rapid increases in independency from imports have been achieved by concentrating on fewer food commodities, as suggested by their rapidly declining production diversity. Clusters H and K (including China and Australia, as well as many countries in Africa and the Middle East) show a contrasting case, where both production and supply diversity have increased at the cost of reduced independency from imports. Another cluster with decreasing production diversity (Cluster I) includes countries such as India and Canada, as well as many European and South American countries. However, in many other respects, Cluster I significantly differs from Cluster J and L, as only import partners show a positive trend (Fig. 6B). In Cluster G, which contains the United States and Sweden, the change in resilience indicators have also been largely negative or weakly positive. Again, results differ for vegetables & fruits (Fig. 6D). Clusters G, H and L show similar patterns, where independency from imports has declined, but other indicators have risen or show no strong trend. Thus, countries such as Brazil, China, India, and Russia, as well as many African and some European countries have increased their supply  (between 1987-1989 and 2011-2013; see also Figs. 1 and 2). For clustering, kmeans clustering method was used. The value of indicator and magnitude of change refer to cluster centres of these clusters. Only countries with data for all the indicators were included into the clustering. See Fig. S5 for calories and fat. diversity with increased reliance on imports from a growing number of partners. Clusters J and K also share a similar pattern, but cluster K, which includes Indonesia, and the Middle East, as well as Sweden and Finland, depend increasingly on fewer import partners. The very opposite trend to these countries can be found in Cluster I, which includes large parts of the Americas, Australia, and various countries in Asia and Africa. There, both production and supply diversity have slightly decreased, while showing a small positive trend in import-related indicators.

Discussion
We have systematically assessed how trade-related resilience indicators of the global food system evolved within the past three decades, and evaluated their current status. Our findings indicate that while a large part of the world population lives in countries where resilience indicators have increased, there is high heterogeneity among countries regarding the different trade-related aspects of resilience of food systems, and how these aspects have developed over the study period. Our analyses can be seen as a first step towards understanding how food trade has shaped food system resilience in different regions in the world, as described by these resilience indicators. Nevertheless, there remains a great potential, and need, for future studies to further deepen and broaden our analyses, which we discuss below.
Our findings are supported by previous studies that describe how the food trade markets have become increasingly delocalized (Tu et al., 2019), and that in large parts of the world this has led to a decrease in production diversity (e.g. Khoury et al., 2014). Further, globalised trade networks have resulted in an increase in food supply diversity (Remans et al., 2014), but as shown by our results, they have also significantly increased trade dependency (Porkka et al., 2013;D'Odorico et al., 2014). Our results also reveal that countries that have achieved high diversity of both food supply and production (in terms of protein) without the cost of high dependency on imports, are often low or middle income countries (e.g. Cluster C in Fig. 6A), which is in line with findings by Remans et al. (2014). In high-income countries, high supply diversity is often achieved through increasing dependency on trade, as summarised by Herrero et al. (2017), and also visible in our results (e.g. Cluster A in Fig. 6A).
A study by Seekell et al. (2017), who also included socio-economic aspects of food system resilience (in addition to biophysical capacity and production diversity), presents interesting findings not captured by our study. They found, for example, that Eastern Africa and South Asia have low socio-economic resilience , whereas we rank them relatively high for many of the indicators we selected (Fig. 4A). Though we were only focusing on trade-related resilience indicators in this study, and thus socio-economic indicators were beyond our scope, this disparity emphasises the point that multiple dimensions of resilience need to be considered when drawing conclusions about the overall resilience of food systems across different countries.
In this study, diversity and connectivity of countries' food systems is assessed in terms of nutritionally relevant components: dietary energy, protein, fat, and vegetables & fruits. While these are important aspects of nutrition, they do not cover all the essential nutritional compounds of foodstuff commodities. When our food supply diversity findings (RP1b -see Table 1) are compared with food supply diversity measured in terms of other key nutrients (carbohydrates, protein, vitamin A, vitamin C, iron, zinc, and folate), as in Remans et al. (2014), we see similar patterns for the most part, particularly in Europe and the Americas, as well as in most parts of Africa, though differences can be seen in some parts of Asia.
Equally relevant as diversity of production or supply for the resilience of food systems is the diversity in responses to shocks among food products that contribute to the same nutritional function, i.e. response diversity (Elmqvist et al., 2003). This would not be captured by our current indicators and remains for future work. Another important aspect left for future studies would be an inclusion of inputs needed for food production, particularly fertilizers, energy and machinery, as well as better representation of animal feedstuff. We considered here only self-sufficiency in terms of food stuffs, but without such inputs -which are often imported -food production at its current level would not be possible.
As mentioned in Section 2, in this assessment we did not consider the potential negative impact of overly connected subsystems, or the rapid spread of disturbances (e.g. Puma et al., 2015;Marchand et al., 2016), but assumed the higher the number of significant trade partners, the higher the resilience. Further, Shutters et al. (2015) conclude that it is crucial to acknowledge the environment where the system is and what kind of shocks are likely to impact on it. Tu et al. (2019), in turn, argue that the resilience of a network is more dependent on the network structure than the system's connectivity. While we did not perform any network analysis in this study, our findings suggest that the way connectivity is managed within the food system is crucial to resilience. Further analysis would be needed to identify which sub-systems are overly connected and thus vulnerable to these rapidly spreading disturbances. An additional consideration not covered in our analysis is trade within a country and an additional analysis of impacts of interprovincial food trade on resilience might open interesting angles on the interplay between food system resilience and trade.

Conclusions
In this article, we provide a novel analysis that examines how two aspects of food system resilience have evolved globally at the national level over the past three decades: maintaining diversity and managing connectivity. Our results indicate that globalisation has had diverse impacts on these resilience indicators. While food supply diversity increased for most of the world, it came with the cost of increased trade dependency, potentially exposing many of these countries to shocks in the few major exporting countries. We also found that food production diversity in these major exporting countries decreased over the study period, while elsewhere it mainly increased or stayed stable. This kind of specialisation has created vulnerabilities and dependencies across the globe, for both exporters and importers alike. Our findings thus highlight the interconnected trade-offs between trade-related aspects of food system resilience, and provide important information for global actors, as well as national policy makers. Our data also enables further analyses on these aspects to broaden and deepen our understanding of how globalisation and increased trade have influenced food system resilience.

Declaration of competing interest
The authors declare no conflict of interest.