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 ! 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.

devtools::install_github("gacatag/adhan")

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(
    method="7",
    city="Helsinki",
    country="Finland",
    month=4,
    year=2024)

The following maps the parayer times of Mecca to helsinki by aligning the Dhuhr of the two cities. So the differences of Fajr, Sunrise, Sunset and midnight from Dhuhur (noon) will be similar to those in Mecca however the Dhuhr prayer time itself would be according to Helsinki, Finland.

HelsinkiMeccaAdhanApr2024<- adhan::adhanMapMonth(
    method="7",
    city="Helsinki",
    country="Finland",
    mapCity="Mecca",
    mapCountry="Saudi Arabia",
    mapBy="Dhuhr",
    month=4,
    year=2024)

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

library("kableExtra")

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

kableExtra::save_kable(x,file="April.pdf")

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


Link of the cover photo: https://www.flaticon.com/free-icon/adhan_2918161.

0

Add a comment

Labels
Blog Archive
About Me
About Me
My Photo
I am a Postdoc researcher at the Neuromuscular Disorders Research lab and Genetic Determinants of Osteoporosis Research lab, in University of Helsinki and Folkhälsan RC. I specialize in Bioinformatics. I am interested in Machine learning and multi-omics data analysis. My go-to programming language is R.
My Blog List
My Blog List
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.