Adjusted savings: net forest depletion (% of GNI)

Source: worldbank.org, 03.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Aruba Aruba 0.00213 -31.7% 93
Afghanistan Afghanistan 0.318 +33.5% 45
Angola Angola 0.739 -15.3% 38
Albania Albania 0.14 +2.89% 57
Argentina Argentina 0 100
Armenia Armenia 0.276 +0.481% 50
Australia Australia 0.124 -16.9% 62
Austria Austria 0.0291 +27.7% 75
Azerbaijan Azerbaijan 0 100
Burundi Burundi 13.9 +1.05% 2
Belgium Belgium 0.00744 -1.5% 87
Benin Benin 0 100
Burkina Faso Burkina Faso 0 100
Bangladesh Bangladesh 0.0714 -7.17% 67
Bulgaria Bulgaria 0 100
Bahamas Bahamas 0.0158 -21.5% 82
Bosnia & Herzegovina Bosnia & Herzegovina 0 100
Belarus Belarus 0 100
Belize Belize 0.249 -29.3% 51
Bolivia Bolivia 0 100
Brazil Brazil 0 100
Barbados Barbados 0.0121 -15.1% 84
Brunei Brunei 0.0486 -12.1% 72
Bhutan Bhutan 2.55 -2.92% 23
Botswana Botswana 0.313 -6.65% 46
Central African Republic Central African Republic 0 100
Canada Canada 0 100
Switzerland Switzerland 0.00172 +34.3% 95
Chile Chile 0 100
China China 0 100
Côte d’Ivoire Côte d’Ivoire 0 100
Cameroon Cameroon 2.64 -4.36% 20
Congo - Kinshasa Congo - Kinshasa 9.97 -2.26% 5
Congo - Brazzaville Congo - Brazzaville 3.11 -26% 17
Colombia Colombia 0 100
Comoros Comoros 1.62 +1.73% 32
Cape Verde Cape Verde 0.302 -7.39% 47
Costa Rica Costa Rica 0 100
Cyprus Cyprus 0 100
Czechia Czechia 0.174 -21.6% 53
Germany Germany 0 100
Djibouti Djibouti 0.282 -15.2% 49
Dominica Dominica 0.033 -27.8% 74
Denmark Denmark 0.00531 +0.571% 89
Dominican Republic Dominican Republic 0.0273 -25.2% 76
Algeria Algeria 0 100
Ecuador Ecuador 0 100
Egypt Egypt 0.111 -15.7% 63
Spain Spain 0 100
Estonia Estonia 0 100
Ethiopia Ethiopia 5.63 +3.43% 8
Finland Finland 0 100
Fiji Fiji 1.2 +15.4% 36
France France 0.0246 +7.03% 77
Micronesia (Federated States of) Micronesia (Federated States of) 0.0162 -10.1% 81
Gabon Gabon 3.14 -10% 16
Georgia Georgia 0.0579 -24.5% 69
Ghana Ghana 3.85 +2.52% 13
Guinea Guinea 5.12 -3.88% 10
Gambia Gambia 2.93 -4.86% 19
Guinea-Bissau Guinea-Bissau 10.4 -5.02% 4
Equatorial Guinea Equatorial Guinea 2.59 -13.8% 21
Greece Greece 0.00861 -5.43% 86
Guatemala Guatemala 0 100
Guyana Guyana 2.34 -40.8% 25
Honduras Honduras 0 100
Croatia Croatia 0.151 -13.5% 55
Haiti Haiti 0.327 -43.2% 44
Hungary Hungary 0 100
Indonesia Indonesia 0 100
India India 0.163 -13.5% 54
Ireland Ireland 0 100
Iran Iran 0 100
Iraq Iraq 0.00327 -15.4% 91
Iceland Iceland 0.000112 +0.309% 98
Israel Israel 0 100
Italy Italy 0.00979 +0.216% 85
Jamaica Jamaica 0.0617 -23.6% 68
Jordan Jordan 0.0204 -8.01% 79
Japan Japan 0 100
Kazakhstan Kazakhstan 0 100
Kenya Kenya 1.24 -3.75% 35
Kyrgyzstan Kyrgyzstan 0 100
Cambodia Cambodia 0 100
Kiribati Kiribati 0.0239 -21.6% 78
South Korea South Korea 0 100
Laos Laos 1.59 -5.79% 33
Lebanon Lebanon 0 100
Liberia Liberia 17.5 -4.6% 1
Libya Libya 0.0759 +11% 66
St. Lucia St. Lucia 0.0139 -29.3% 83
Sri Lanka Sri Lanka 0.0558 -3.16% 70
Lesotho Lesotho 3.79 -6.39% 15
Lithuania Lithuania 0 100
Luxembourg Luxembourg 0.00621 -31.1% 88
Latvia Latvia 0 100
Morocco Morocco 0 100
Moldova Moldova 0 100
Madagascar Madagascar 5.56 -3.76% 9
Maldives Maldives 0.00407 -25.7% 90
Mexico Mexico 0 100
North Macedonia North Macedonia 0 100
Mali Mali 2.34 -2.93% 24
Myanmar (Burma) Myanmar (Burma) 2.23 +11.7% 26
Montenegro Montenegro 0.135 -22.6% 58
Mongolia Mongolia 0 100
Mozambique Mozambique 0 100
Mauritania Mauritania 0.653 -5.97% 39
Mauritius Mauritius 0.0021 +3.65% 94
Malawi Malawi 4.28 +3.08% 11
Malaysia Malaysia 1.75 -7.84% 31
Namibia Namibia 0.88 -1.99% 37
Niger Niger 0 100
Nigeria Nigeria 0 100
Nicaragua Nicaragua 0 100
Netherlands Netherlands 0 100
Norway Norway 0 100
Nepal Nepal 0.49 -4.5% 43
New Zealand New Zealand 0 100
Oman Oman 0.00145 -20% 96
Pakistan Pakistan 0.13 -11.5% 59
Panama Panama 0 100
Peru Peru 0.128 -7.43% 61
Philippines Philippines 0 100
Papua New Guinea Papua New Guinea 2.04 -9.86% 27
Poland Poland 0 100
Portugal Portugal 0.092 -5.11% 65
Paraguay Paraguay 1.31 -23.2% 34
Qatar Qatar 0.00007 -25.8% 99
Romania Romania 0 100
Russia Russia 0 100
Rwanda Rwanda 3.83 -2.99% 14
Sudan Sudan 0 100
Senegal Senegal 0 100
Singapore Singapore 0.000206 -26.4% 97
Solomon Islands Solomon Islands 0 100
Sierra Leone Sierra Leone 7.98 +6.64% 7
El Salvador El Salvador 0.567 -29.7% 41
Somalia Somalia 11.3 -1.92% 3
Serbia Serbia 0 100
São Tomé & Príncipe São Tomé & Príncipe 1.86 -4.86% 30
Suriname Suriname 1.9 -0.319% 28
Slovakia Slovakia 0 100
Slovenia Slovenia 0.149 -17.1% 56
Sweden Sweden 0 100
Eswatini Eswatini 2.58 -14.9% 22
Seychelles Seychelles 0.128 -7.93% 60
Turks & Caicos Islands Turks & Caicos Islands 0.00323 -24.9% 92
Chad Chad 3.96 -8.5% 12
Togo Togo 2.98 -4.66% 18
Thailand Thailand 0 100
Tajikistan Tajikistan 0.642 -2.21% 40
Timor-Leste Timor-Leste 0.103 +5.47% 64
Tonga Tonga 0.0386 +7.28% 73
Trinidad & Tobago Trinidad & Tobago 0.0545 -26.3% 71
Tunisia Tunisia 0.211 -15.3% 52
Tanzania Tanzania 0 100
Uganda Uganda 8.64 +1.4% 6
Ukraine Ukraine 0 100
Uruguay Uruguay 0 100
United States United States 0 100
Uzbekistan Uzbekistan 0 100
St. Vincent & Grenadines St. Vincent & Grenadines 0.0194 -24.6% 80
Vietnam Vietnam 0 100
Vanuatu Vanuatu 0.518 -9.67% 42
Samoa Samoa 0.285 -8.68% 48
South Africa South Africa 0 100
Zambia Zambia 0 100
Zimbabwe Zimbabwe 1.87 -19.4% 29

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'NY.ADJ.DFOR.GN.ZS'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'NY.ADJ.DFOR.GN.ZS'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))