> -Message d'origine-
> De : [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] la part de Prof Brian Ripley
> Envoye : mercredi 10 mars 2004 08:22
> A : Thomas Petzoldt
> Cc : [EMAIL PROTECTED]
> Objet : Re: [R] years from as.POSIXlt
>
>
> On Wed, 10 Mar 2004
On Wed, 10 Mar 2004, Thomas Petzoldt wrote:
(without copying me)
> Prof Brian Ripley wrote:
>
> > See ?julian, which says
> >
> > Note:
> >
> > Other components such as the day of the month or the year are very
> > easy to computes: just use 'as.POSIXlt' and extract the relevant
> >
On Wed, 10 Mar 2004, Thomas Petzoldt wrote:
> >as.numeric(format(x, f="%j"))
>
> which is the right code, works perfectly, too.
but the recommended procedure is on the help page ?julian, and of course
works perfectly. Just use 1+x$yday if you want 1-based day of the year.
--
Brian D. Ripley,
internally as the number of days since January 1, 1970.
---
Date: Wed, 10 Mar 2004 00:04:30 +0100
From: Thomas Petzoldt <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Re: [R] years from as.POSIXlt
Prof Brian Ripley wrote:
> See ?julian, which says
>
> N
as.numeric(format(x, f="%j"))
which is the right code, works perfectly, too.
Thomas P.
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Prof Brian Ripley wrote:
See ?julian, which says
Note:
Other components such as the day of the month or the year are very
easy to computes: just use 'as.POSIXlt' and extract the relevant
component.
Hello,
unfortunately not all mentioned functions work on all machines. Where
> m
On Mon, 8 Mar 2004, Christian Schulz wrote:
> how it's possible to extract the year and the number
> of days from Julian date. i'm little confused about the last two
> functions and ?years .
>
> EDATE comes from sqlQuery with as.is=T
> EDATE <- as.POSIXlt(datvears$ENROLLDAY)
> > EDATE[1:5]
> [
days and years are from the chron package and operate on
chron objects, not POSIXlt objects.
If you have a POSIXlt object, EDATE, you can get the years
and julian day of the year like this:
as.numeric(format(EDATE,"%Y"))
as.numeric(format(EDATE,"%j"))
See ?strptime for those % codes and many