On Wed, Apr 21, 2010 at 6:50 PM, Michael Hosack wrote:
>
>
> I provided a minimized version of my dataframe at the bottom of this message
> containing the results of David's code in variable ('wkoffset') and Jeff
> Hallman's code in ('WEEK'). Jeff's code produced the correct results (thank
> yo
roach
you
provided does not end Week 1 on a Friday and does not end subsequent
week #'s on Fridays.
My solution should be adjustable for any day-of-week ending number.
Why don't you provide a minimal example for testing and show how
apply
my solution fails? Your original version was defin
Gustaf,
That is correct. Schedule3 does contain all of the Saturdays between April 30
and Nov. 01 for a given year.
Mike
R experts,
>
> How could I extract the week number from a date vector (in Date class)
> such that week numbering (week 1...2...) begins (May 01) and ends
> (October 31
#x27;s on Fridays.
>
> My solution should be adjustable for any day-of-week ending number.
> Why don't you provide a minimal example for testing and show how apply
> my solution fails? Your original version was definitely not "minimal."
> --
> David.
>>
>> Thanks again,
>>
>> Mike
>>
how how apply
my solution fails? Your original version was definitely not "minimal."
--
David.
Thanks again,
Mike
CC: mhosack9 at hotmail.com; r-help at r-project.org
From: dwinsemius at comcast.net
To: dwinsemius at comcast.net
Subject: Re: [R] Assigni
r.
Why don't you provide a minimal example for testing and show how apply
my solution fails? Your original version was definitely not "minimal."
--
David.
>
> Thanks again,
>
> Mike
>
>
>> CC: mhosack9 at hotmail.com; r-
On Tue, Apr 20, 2010 at 7:59 PM, Michael Hosack wrote:
>
> R experts,
>
> How could I extract the week number from a date vector (in Date class)
> such that week numbering (week 1...2...) begins (May 01) and ends
> (October 31) on the same specific dates each year? Week numbering
> must conform to
insem...@comcast.net
Subject: Re: [R] Assigning Week Numbers
Date: Tue, 20 Apr 2010 16:03:09 -0400
On Apr 20, 2010, at 2:55 PM, David Winsemius wrote:
On Apr 20, 2010, at 1:59 PM, Michael Hosack wrote:
R experts,
How could I extract the week number from a date vector (in Date
class)
such that
Take a look at the 'ti' stuff in the tis package on CRAN. If I
understand you correctly, you want something like this:
weekNumber <- function(aDate){
aTi <- ti(aDate, tif = "wfriday")
may1ymd <- 1*year(aTi) + 501
baseWeek <- ti(may1ymd, tif = "wfriday")
return(aTi - baseWeek +
9 matches
Mail list logo