[R] how to convert decimal date to its equivalent date format(YYYY.mm.dd.hr.min.sec)

2007-08-07 Thread Yogesh Tiwari
Hello R Users, How to convert decimal date to date as .mm.dd.hr.min.sec For example, I have decimal date in one column , and want to convert and write it in equivalent date(.mm.dd.hr.min.sec) in another next six columns. 1979.00 1979.020833 1979.041667 1979.062500 Is it

Re: [R] how to convert decimal date to its equivalent date format(YYYY.mm.dd.hr.min.sec)

2007-08-07 Thread jim holtman
Is this what you want? x - scan(textConnection(1979.00 + + 1979.020833 + + 1979.041667 + + 1979.062500), what=0) Read 4 items # get the year and then determine the number of seconds in the year so you can # use the decimal part of the year x.year - floor(x) # fraction of the year x.frac