[R] How to convert day-month-year to Julian data number?

jim holtman jholtman at gmail.com
Tue Jan 1 23:07:26 CET 2008


Is this what you want?

> x <- c('5/5/2007', '12/31/2007')
> # convert to day of year (Julian date) -- use POSIXlt
> strptime(x, "%m/%d/%Y")$yday+1
[1] 125 365



On Jan 1, 2008 4:59 PM, Nüzhet Dalfes <dalfes at gmail.com> wrote:
> Hi,
>
> Is there a package for converting day-month-year type date to julian
> day number (JDN)? I looked around and I couldn't find any (I am pretty
> new to R...)
>
> Thanks and happy New Year to everybody!
>
>
>
>
> H. Nüzhet Dalfes
>
> Professor,
> Istanbul Technical University
> Eurasia Institute of Earth Sciences
> +90 (532) 206-1308
> [dalfes at itu.edu.tr]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?




More information about the R-help mailing list