nk <- read.csv("https://raw.githubusercontent.com/jconno/NK-food/main/North%20Korea%20food.csv")
str(names(nk))
## chr [1:40] "ï..Year" "Area.Harvested..1000.Ha" "Yield.MT...Ha" ...
nk <- rename(nk,c(Year = ï..Year, Harvested_Area = Area.Harvested..1000.Ha, Yield = Yield.MT...Ha, Amount_Produced = Production.Quantity..1000.MT, Amount_Imported = Import.Quantity.1000.MT, Amount_Exported = Export.Quantity.1000.MT, Stock_Variation = Stock.Variation.1000.MT, Crop_Care = Feed...Seed.1000.MT, Annual_Food_Available = Food.Availability.per.capita.kg.cap.yr, Amount_Grain_Aid = Cereal.Food.Aid.Grain.Equiv..1000.MT, FAO_Conv_rate_root_crops = FAO.Conversion.Rate.for.Root.Crops.from.MT.to.Grain.Equiv..MT, Area_Harvested = Area.Harvested.1000.Ha, Yield_per_Hectacre = Yield.MT...Ha.1, Grain_Exported = Export.Quantity.Grain.Equiv..1000.MT, Stock_Variation_Grain = Stock.Variation.Grain.Equiv..1000.MT, Crop_Care_Grains = Feed...Seed.Grain.Equiv..1000.MT, Waste_Processed = Waste...Processed...OtherUtilization...Stock.Variation, Available_Grain_Foods = Food.Availability.Grain.Equiv..1000.MT, Grain_Food_Availability_1 = Food.Availability.per.capita.kg.cap.yr.1, Grain_Produced = Production.Quantity.Grain.Equiv..1000.MT.1, Food_Availability_2 = Food.Availability.per.capita.kg.cap.yr.2, Grain_Supply_MT = Food.Supply.Grain.Equiv..1000.MT, Thousand_HA_Harvested = Area.Harvested.1000.Ha.1, Grain_Supply_KG = Food.Supply.Grain.Equiv..kg.cap.yr, Grain_Supply_MT_year = Food.Supply.Grain.Equiv..1000.MT...yr, Total_Population = Total.Population...Both.Sexes.Million, Population_Growth_Rate = Population.Growth.Rate.Percent, GDP_Price_Changes = Gross.Domestic.Product..constant.prices.Percent.change, GDP_USD = GDP..constant.2010.US...Million, World_Bank_GDP = WB.GDP..constant.2005.US.....FAO.population...Person, Imports_USD_Millions = Imports.of.goods.and.services..constant.2010.US...Million, Exports_USD_Millions = Exports.of.goods.and.services..constant.2010.US...Million, Import_Value = Import.Value.Million.US., Imports_MT = Import.Unit.Value.US....MT))
str(names(nk))
## chr [1:40] "Year" "Harvested_Area" "Yield" "Amount_Produced" ...
Units of measure: Area/Land = Hectacres Crops/Food/Tangiable Objects = Megatonnes Population/Money = Millions
Areas Harvested and Yield
c <- nk %>% select(Year, Harvested_Area, Yield)
summary(c)
## Year Harvested_Area Yield
## Min. :1990 Min. :1234 Min. :1.740
## 1st Qu.:1996 1st Qu.:1316 1st Qu.:2.390
## Median :2003 Median :1333 Median :2.640
## Mean :2003 Mean :1383 Mean :2.913
## 3rd Qu.:2010 3rd Qu.:1447 3rd Qu.:3.310
## Max. :2016 Max. :1601 Max. :4.530
## NA's :2 NA's :2
ggplot(c, aes(x = Harvested_Area, y = Yield)) + geom_line(colour="red", linetype="dashed", size=0.5) + geom_point(colour="red", size=4, shape=10, fill="white") + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
## Warning: Removed 2 rows containing non-finite values (stat_smooth).
## Warning: Removed 2 row(s) containing missing values (geom_path).
## Warning: Removed 2 rows containing missing values (geom_point).
Harvest, export, availability
harvest <- nk %>% select(Year, Total_Population, Harvested_Area, Yield, Amount_Produced, Food.Availability.1000.MT, Annual_Food_Available)
head(harvest)
## Year Total_Population Harvested_Area Yield Amount_Produced
## 1 1990 20.19 1601 4.32 6909
## 2 1991 20.51 1543 4.53 6992
## 3 1992 20.84 1550 4.12 6391
## 4 1993 21.17 1491 4.39 6540
## 5 1994 21.48 1524 3.85 5872
## 6 1995 21.76 1521 2.24 3399
## Food.Availability.1000.MT Annual_Food_Available
## 1 3994 197.79
## 2 4125 201.12
## 3 4104 196.95
## 4 4126 194.95
## 5 4138 192.65
## 6 3626 166.60
summary(harvest)
## Year Total_Population Harvested_Area Yield Amount_Produced
## Min. :1990 Min. :20.19 Min. :1234 Min. :1.740 Min. :2301
## 1st Qu.:1996 1st Qu.:22.13 1st Qu.:1316 1st Qu.:2.390 1st Qu.:3394
## Median :2003 Median :23.45 Median :1333 Median :2.640 Median :3619
## Mean :2003 Mean :23.20 Mean :1383 Mean :2.913 Mean :4075
## 3rd Qu.:2010 3rd Qu.:24.43 3rd Qu.:1447 3rd Qu.:3.310 3rd Qu.:4281
## Max. :2016 Max. :25.28 Max. :1601 Max. :4.530 Max. :6992
## NA's :2 NA's :2
## Food.Availability.1000.MT Annual_Food_Available
## Min. :3056 Min. :127.9
## 1st Qu.:3376 1st Qu.:140.8
## Median :3626 Median :147.7
## Mean :3589 Mean :155.8
## 3rd Qu.:3734 3rd Qu.:163.9
## Max. :4138 Max. :201.1
##
Population and Food availability
population_food <- nk %>% select(Year, Annual_Food_Available, Total_Population)
summary(population_food)
## Year Annual_Food_Available Total_Population
## Min. :1990 Min. :127.9 Min. :20.19
## 1st Qu.:1996 1st Qu.:140.8 1st Qu.:22.13
## Median :2003 Median :147.7 Median :23.45
## Mean :2003 Mean :155.8 Mean :23.20
## 3rd Qu.:2010 3rd Qu.:163.9 3rd Qu.:24.43
## Max. :2016 Max. :201.1 Max. :25.28
ggplot(population_food, aes(x =Annual_Food_Available, y =Total_Population)) + geom_line(colour="red", linetype="dashed", size=0.5) + geom_point(colour="blue", size=4, shape=10, fill="white") + geom_smooth()
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'