Hi Agustin,

You can check and adapt this solution to your needs:

http://stackoverflow.com/questions/9465817/count-days-per-year

Regards,
Carlos Ortega
www.qualityexcellence.es

2012/6/8 Agustin Lobo <agustin.l...@ictja.csic.es>

> Hi!
> Is not there an standard R function to retrieve the day of the year
> (since 1st Jan of the same year)?
> I know I can make my own using julian, but find it weird that having
> days(), months() etc doy() does not exist as an standard function.
>
> Also, is the following not a bit inconsistent?
>
> > a <- chron("20100506",format="ymd")
> > a
> [1] 100506
> > years(a)
> [1] 2010
> Levels: 2010
>
> but instead have to cast to Date to apply julian:
> > julian(a)
> Error in names(d) : 'd' is missing
> > julian(as.Date(a))
> [1] 14735
> attr(,"origin")
> [1] "1970-01-01"
>
> Thanks
>
> Agus
>
> --
> --
> Dr. Agustin Lobo
> Institut de Ciencies de la Terra "Jaume Almera" (CSIC)
> Lluis Sole Sabaris s/n
> 08028 Barcelona
> Spain
> Tel. 34 934095410
> Fax. 34 934110012
> e-mail agustin.l...@ictja.csic.es
> https://sites.google.com/site/aloboaleu/
>
> ______________________________________________
> R-help@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.
>



-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to