Hi Bendix, Many thanks - yes, I had already visited Homam's page. I have posted a message there asking if there is some way to link his code / function to my MS Access database, but having this as a function in R would be better.
Any takers, who know both C and R? Should I also post this to the R devel list? Best wishes, Amy On Wed, Jan 7, 2009 at 12:26 PM, BXC (Bendix Carstensen) <b...@steno.dk>wrote: > Hi Amy, > you probaly already have visited: > http://www.codeproject.com/KB/cs/JalaliCalendar.aspx > where the Iranian guy Homam Hosseini provides a discussion of the > conversion, and some C code to do it. > > I am a C ignorant, but surely someone in the R-community would be able to > take this code (and in collaboration with Homam) provide a function that > converts Iranian / Jalali dataes to and from the Gregorian Date class?? > > Best regards > Bendix > > > -----Original Message----- > > From: r-sig-epi-boun...@stat.math.ethz.ch > > [mailto:r-sig-epi-boun...@stat.math.ethz.ch] On Behalf Of Amy Mikhail > > Sent: 7. januar 2009 12:40 > > To: r-sig-epi@stat.math.ethz.ch > > Subject: [R-sig-Epi] Converting dates from the Persian > > calendar to Gregorian > > > > Dear Epi list, > > > > This is not a strictly epidemiological question, but an issue > > that anyone might face if presented with a dataset containing > > dates in a non-gregorian format. > > > > I am currently developing a database (in MS Access) for a > > public health study, the results of which I intend to analyse > > in R. I have a small problem, in that the date each patient > > visits the clinic will be entered into the database in the > > Persian / Jalali calendar format - e.g. today's > > date in the Persian calendar is 18.10.1387. For the > > analysis however I > > need these dates to be converted to Gregorian, so that I can > > have months on the x axis of plots, etc. > > > > Does anyone know of a function / some code already written > > that could do this conversion in R? It is much too complex > > for me to figure out (since the Persian new year starts on > > 21st March, and although there are also 12 months they have > > different lengths to gregorian months). I'm guessing it > > would require loops and such but this is beyond my current > > level of R knowledge. > > > > I have found some online tools that do the conversion of > > individual dates, but there seems to be nothing out there > > that would convert a whole dataset's worth of dates. > > > > Any suggestions much appreciated, > > 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-sig-Epi@stat.math.ethz.ch mailing list > > https://stat.ethz.ch/mailman/listinfo/r-sig-epi > > -- 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-sig-Epi@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-epi