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
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