[R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Hi, I have these vectors: WEEK - rep(c(1:52),2) YEAR - rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- Realmente minha cidade e muito

[R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Hi, I have these vectors: WEEK - rep(c(1:52),2) YEAR - rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work with weeks, just only with days, months etcs. Thanks Ronaldo -- Realmente minha cidade e muito

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
Try: as.Date(paste(YEAR, WEEK, 0), %Y %U %w) On 3/15/06, Ronaldo Reis-Jr. [EMAIL PROTECTED] wrote: Hi, I have these vectors: WEEK - rep(c(1:52),2) YEAR - rep(c(2000,1999),c(52,52)) How to make a vector of Date with weeks in years? I try as.date from survival package, but it dont work

Re: [R] manipulating weeks dates

2006-03-15 Thread Ronaldo Reis-Jr.
Em Quarta 15 Março 2006 10:26, Gabor Grothendieck escreveu: as.Date(paste(YEAR, WEEK, 0), %Y %U %w) Hi, it works, but it use a year with 53 weeks, I need to use with 52 weeks, how to change this? Thanks Ronaldo -- Errigal Mountains -- Tailoring manure -- anagrama -- | // |

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
Given that there are more than 7 * 52 days in a week you may need to think about what it is that you want. This will give you Jan 1 for Week 1, Jan 8 for Week 2, etc. as.Date(paste(YEAR,1,1,sep=-)) + 7 * (WEEK - 1) That or some variation of that might be suitable. See the help desk article in

Re: [R] manipulating weeks dates

2006-03-15 Thread Gabor Grothendieck
I meant there are more than 7 * 52 days in a year. On 3/15/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Given that there are more than 7 * 52 days in a week you may need to think about what it is that you want. This will give you Jan 1 for Week 1, Jan 8 for Week 2, etc.