data <- read.csv("data/laos/population_laosis.csv")

data <- data[-c(1:2), ]
colnames(data) <- c("province", "population")
data$population <- as.numeric(data$population) * 1000
sum(data$population)

data$province[data$province == "Phongsaly"] <- "Phongsali"
data$province[data$province == "Xaysomboon"] <- "Xaisomboun"
data$province[data$province == "Attapeu"] <- "Attapu"
data$province[data$province == "Champasack"] <- "Champasak"
data$province[data$province == "Sekong"] <- "Xekong"
data$province[data$province == "Saravane"] <- "Salavan"
data$province[data$province == "Khammuane"] <- "Khammouan"
data$province[data$province == "Borikhamxay"] <- "Bolikhamxai"
data$province[data$province == "Xiengkhuang"] <- "Xiangkhouang"
data$province[data$province == "Xayaboury"] <- "Xainyabouli"
data$province[data$province == "Huaphanh"] <- "Houaphan"
data$province[data$province == "Luangprabang"] <- "Louangphabang"
data$province[data$province == "Oudomxay"] <- "Oudomxai"
data$province[data$province == "Luangnamtha"] <- "Louangnamtha"
data$province[data$province == "Khammuane"] <- "Khammouan"
data$province[data$province == "Saravane"] <- "Salavan"
data$province[data$province == "Khammuane"] <- "Khammouan"
data$province[data$province == "Saravane"] <- "Salavan"
data$province[data$province == "Khammuane"] <- "Khammouan"


write.csv(data, "data/laos/laos_population_2022.csv", row.names = FALSE)
