ethiodate

R-CMD-check CRAN status cran checks minimal R version Codecov test coverage Lifecycle: stable DOI

This package enables you to work with Ethiopian dates in R like you do with base R Date objects. It can seamlessly convert to and from Gregorian dates, regardless of the way you record them. It supports almost all important parsing techniques used for a base R Date object. If you have ever worked with a Date object, you can do the same with Ethiopian dates. It is designed to work smoothly with the {tidyverse}, including {ggplot2}, {dplyr}, {tibble}, and {lubridate}, making it ideal for data manipulation pipelines. This package ensures lightning-fast computations thanks to the {Rcpp} package that enables the integration of high-performance C++ code. It has built-in checks for leap years and the 13th month (Pagume), which makes this package crucial.

Key Features:

Installation

You can install the development version of ethiodate package like so:

# Install the current version on CRAN
install.packages("ethiodate")

# Install a stable development version from GitHub (requires compilation)
devtools::install_github("GutUrago/ethiodate")

Usage

This package is for you if you have ever faced the following conditions, where;

Examples:

library(ethiodate)
library(dplyr)

data.frame(
  eth_year = c(2000, 2007, 2015, 2020, 1950, 2030),
  eth_month = c(8, 2, 13, 5, 7, 5),
  eth_day = c(25, 12, 6, 8, 17, 30)
) |> 
  mutate(
    eth_date = eth_make_date(eth_year, eth_month, eth_day),
    gre_date = as.Date(eth_date),
    eth_dayname = eth_weekday(eth_date, lang = "en"), 
    gre_dayname = weekdays(gre_date) 
  )
#>   eth_year eth_month eth_day   eth_date   gre_date eth_dayname gre_dayname
#> 1     2000         8      25 2000-08-25 2008-05-03    Saturday    Saturday
#> 2     2007         2      12 2007-02-12 2014-10-22   Wednesday   Wednesday
#> 3     2015        13       6 2015-13-06 2023-09-11      Monday      Monday
#> 4     2020         5       8 2020-05-08 2028-01-17      Monday      Monday
#> 5     1950         7      17 1950-07-17 1958-03-26   Wednesday   Wednesday
#> 6     2030         5      30 2030-05-30 2038-02-07      Sunday      Sunday