View source: R/check_country_overlap.R
check_country_overlap | R Documentation |
The function only works for FAOST_CODE. If the country coding system is not in FAOST_CODE then use the translateCountryCode function to translate it.
check_country_overlap(
var,
year = "Year",
data,
type = c("overlap", "multiChina"),
take = c("simpleCheck", "takeNew", "takeOld", "complete")
)
var |
The variable to be checked. |
year |
The column which index the time. |
data |
The data frame. |
type |
The type of check. |
take |
The type of check/replacement to be done in case of type equals to overlap. |
test.df =
data.frame(FAOST_CODE = rep(c(51,167,199), each = 3),
Year = rep(c(1990:1992), 3),
Value = c(c(3,4,4), c(2,2,2), c(1,2,NA)))
check_country_overlap(var = "Value", data = test.df, type = "overlap", take = "simpleCheck")
check_country_overlap(var = "Value", data = test.df, type = "overlap", take = "takeNew")
check_country_overlap(var = "Value", data = test.df, type = "overlap", take = "takeOld")
check_country_overlap(var = "Value", data = test.df, type = "overlap", take = "complete")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.