Dear list,

I will shortly have some data that contains numeric dates in the Persian /
Jalali calendar format, which I would like to convert to gregorian.  At the
moment there doesn't seem to be a function for this in R, but it would be
great if someone could come up with same - I would attempt it but the
algorithm is very complex and this is also way beyond my fairly rudimentary
knowledge of R.

There is an informative article about how this can be done in C by Homam
Hosseini here:

http://www.codeproject.com/KB/cs/JalaliCalendar.aspx

and a different attempt here:

http://www.projectpluto.com/calendar.htm#jalali

... and several other examples (mostly in C I think) can be found by
googling Persian Jalali calendar.  Aside from being written in C, the other
problem with all the code snippets I found is that they are only for
converting single dates - whereas I would like to convert an entire column
of dates within a data.frame.  To do this I would need to be able to first
set the date class of my date column as Persian/Jalali and then have a
function to convert these dates to gregorian.

I originally posted my question to the R-SIG-epi list (on the off-chance
that this might be a common problem and someone else had already written
code for it); Bendix Carstensen has suggested that someone with both C and R
knowledge might be able to develop a function to do this for R, perhaps in
consultation with Homam Hosseini if converting his code to R or using his
approach would be a helpful starting point.

Any takers?

With best wishes,
Amy



-- 
Amy Mikhail
Program Manager, ACTc Afghanistan Malaria Project
London School of Hygiene & Tropical Medicine
HPRO, Charahi-e-Shahid, Shar-e-Naw, Kabul, Afghanistan

Email (Afg): amy.mikh...@googlemail.com
Email (UK): amy.mikh...@lshtm.ac.uk
Tel (Afg): +93 (0)706 126627
Tel (UK): +44 (0)781 4176107

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to