Skip to content

m-mburu/kenyaFoodPrices

Repository files navigation

kenyaFoodPrices

R-CMD-check

This is a package to visualize food prices in Kenya. The data is sourced from the World Food Programme (WFP) and is available on the Humanitarian Data Exchange (HDX) platform. The app is hosted on shinyapps.io and can be accessed here.

Installation

You can install the development version of kenyaFoodPrices from GitHub with:

# install.packages("devtools")
#devtools::install_github("m-mburu/kenyaFoodPrices")
library(kenyaFoodPrices)
library(ggplot2)
library(dplyr)
library(data.table)
library(ggthemes)
data(ke_food_prices)


ke_food_prices_maize <- ke_food_prices[commodity == "Maize" & pricetype == "Retail" & unit =="KG",]

ke_food_prices_maize[, .(mean_price = mean(price)), by = .(year_quarter_date)] %>%
  ggplot(aes(x = year_quarter_date, y = mean_price)) +
  geom_line(, color = "#66A61E") +
  labs(title = "1KG of Maize Price in Kenya",
       x = "Date",
       y = "Mean Price") +
  scale_x_date(date_labels = "%m/%y", breaks = "24 month") +
 theme_hc()+
  theme(legend.position = "bottom")

# Example usage of the function
display_time_in_timezone("Africa/Nairobi")
#> Last Run On (Your System Timezone): 2025-01-01 00:51:48 UTC
#> Last Run On (Specified Timezone): 2025-01-01 03:51:48 Africa/Nairobi
  • Thanks to WFP for providing the data on Humanitarian Data Exchange (HDX)

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published