In order to do any conversion, you have to know the format of the data
that is being input.  So which is it:  does 52 represent the day of
the year, or the week of the year?  Does make a big difference, but
until you know what "1952-52" means, it is hard to specify which way
you should do the conversion.

On Mon, Jul 2, 2012 at 9:12 AM, arun <smartpink...@yahoo.com> wrote:
> Hi Jim,
>
> I tried,
>
> dat2<-as.Date(dat1,format="%Y-%V")
>> dat2
> [1] "1951-07-02" "1952-07-02"
>
> But, if the format is for YYYY-wk or YYYY-yy, then, not sure how this will 
> help.
>
> A.K.
>
>
>
>
> ----- Original Message -----
> From: jim holtman <jholt...@gmail.com>
> To: Karan Anand <anand.kara...@gmail.com>
> Cc: r-help@r-project.org
> Sent: Monday, July 2, 2012 9:04 AM
> Subject: Re: [R] enquiry
>
> try this:
>
>> as.Date('1951-52', format = "%Y-%j")
> [1] "1951-02-21"
>>
>
>
> On Mon, Jul 2, 2012 at 5:44 AM, Karan Anand <anand.kara...@gmail.com> wrote:
>> hi,
>>     i am new  to using r .so if you can pls  tell me how  to read "1951-52"
>> ,"1952-52"     date format in r
>>
>>         [[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.
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
> ______________________________________________
> 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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?
Tell me what you want to do, not how you want to do it.

______________________________________________
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