[This article was first published on gacatag, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.


The adhan package is available here !

 The prayer times cannot always be estimated accurately in some places such as countries located in higher latitudes (e.g. the Nordic countries) . as for instance during midsummer time the Fajr may be impossible to estimate or in other words it may simply not exist ! Some Muslim residents of those countries follow Prayer times of other places such as Mecca and Medina. However, day light saving times can make it complicated ! Furthermore, some align the Dhuhr prayer time of Mecca to the local Dhuhr time and measure all the remaining times based on their differences from Dhuhr in Mecca. This would also resolve complications caused by the daylight saving time. The adhan package facilitates mapping of the prayer times of two locations based on alignment over a specific time (e.g. Dhuhr).  It can also show the prayer times of a city using several methods. The package is dependent on the  Aladhan API.

 The library is available on GACATAG GitHub. It can be installed using install_github() function supported by devtools package.


The following script shows the local prayer times of Helsinki, Finland for today (1st of April 2024), measured by the “Institute of Geophysics, University of Tehran” method. A specific day and month na dyear can also be mentioned. For more info check the parameter settings by typing ?adhan::adhan.

adhan::adhan(city=”Helsinki”, country=”Finland”, method=7)
#          date           Fajr        Sunrise          Dhuhr            Asr         Sunset        Maghrib
#  “01-04-2024” “04:07 (EEST)” “06:44 (EEST)” “13:24 (EEST)” “16:50 (EEST)” “20:05 (EEST)” “20:36 (EEST)”
#          Isha          Imsak       Midnight     Firstthird      Lastthird
#”22:02 (EEST)” “03:57 (EEST)” “01:24 (EEST)” “23:38 (EEST)” “03:11 (EEST)”

Currently there are 17 methods which are supported by the Aladhan API. Defining a custom method is also possible. The following shows the Helsinki prayer times for the entire month of April 2024.

HelsinkiAdhanApr2024<- adhan::adhanMonth(

The following maps the parayer times of Mecca to helsinki by aligning the Dhuhr of the two cities.

HelsinkiMeccaAdhanApr2024<- adhan::adhanMapMonth(
    mapCountry=”Saudi Arabia”,

The tables can be organized into a nicer format using functions from the kableExtra library.

x<- kbl(HelsinkiMeccaAdhanApr2024,
    table.attr = “style=’width:100%;’” ) %>%
    kable_classic(full_width = TRUE, position = “center” )


as_image(x, file=”April.png”)

To leave a comment for the author, please follow the link and comment on their blog: gacatag.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you’re looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don’t.

Continue reading: adhan package: retreiving and aligning the prayer times in R

Key Insights from the Adhan Package

The revealed information about the adhan package is exciting for the Muslim community, especially the ones residing in higher latitude places. Compiled from the Aladhan API, the package can map prayer times for any two locations and show prayer times of a city through multiple methods. It looks to solve the complexities arising from daylight savings while providing a platform for accuracy and widespread adoption.

Long term implications and future developments

The adhan package’s future seems to hold immense promise as it continues to assist Muslims worldwide, especially those residing in higher latitudes, with more accurate prayer times. However, the future will still see significant advancements and feature additions for additional convenience and accuracy.

Potential advancements in convenience

In the future, users could expect to see enhanced functionality in setting tailored alerts or reminders based on accurate prayer timings, thereby avoiding the worry of missing a prayer. Additionally, integrating the package with commonly used smart home devices may also be a prospective development, making it even more convenient for users.

Improved accuracy and location coverage

While the package already boasts considerable accuracy, future updates may aim to perfect this with ongoing tweaks and adjustments. Furthermore, expanding location coverage beyond existing capabilities might even eliminate the need to use estimates, providing even the remotest participants with precise prayer timings.

Actionable Advice

For enthusiasts looking to maximize the benefits from the adhan package, here are some recommendations:

  1. Constant updates: Regularly updating the package ensures users benefit from the latest additions and improvements, maintaining accuracy and consistency.
  2. Learn the nuances: Understanding the underlying principles and functionalities of the adhan package can help users tailor it more effectively to their needs.
  3. Reach out for support: If you encounter any issues, reaching out to the broader community can be helpful. The package’s GitHub repository is also a treasure trove of valuable information and solutions.

In conclusion, the adhan package’s importance and potential for future developments is immense, making it an essential tool for Muslims globally. By understanding its functions and keeping it updated, users can ensure they reap its maximum benefits.

Read the original article