Create decimal time on an annual scale from an input time vector
dec_time(date_in)
# S3 method for Date
dec_time(date_in)
input time vector, usually a date
object
A named list of four numeric vectors including day_num
(decimal day on an annual scale), month
(month of the year as integer), year
, and dec_time
(decimal time as sum of year
and day_num
)
Function is used internally within the package.
dt <- Sys.Date()
dts <- seq.Date(dt - 365, dt, by = 'day')
dec_time(dts)
#> $day_num
#> [1] 0.802739726 0.805479452 0.808219178 0.810958904 0.813698630 0.816438356
#> [7] 0.819178082 0.821917808 0.824657534 0.827397260 0.830136986 0.832876712
#> [13] 0.835616438 0.835616438 0.841095890 0.843835616 0.846575342 0.849315068
#> [19] 0.852054795 0.854794521 0.857534247 0.860273973 0.863013699 0.865753425
#> [25] 0.868493151 0.871232877 0.873972603 0.876712329 0.879452055 0.882191781
#> [31] 0.884931507 0.887671233 0.890410959 0.893150685 0.895890411 0.898630137
#> [37] 0.901369863 0.904109589 0.906849315 0.909589041 0.912328767 0.915068493
#> [43] 0.917808219 0.917808219 0.923287671 0.926027397 0.928767123 0.931506849
#> [49] 0.934246575 0.936986301 0.939726027 0.942465753 0.945205479 0.947945205
#> [55] 0.950684932 0.953424658 0.956164384 0.958904110 0.961643836 0.964383562
#> [61] 0.967123288 0.969863014 0.972602740 0.975342466 0.978082192 0.980821918
#> [67] 0.983561644 0.986301370 0.989041096 0.991780822 0.994520548 0.997260274
#> [73] 1.000000000 1.002739726 0.005479452 0.008219178 0.010958904 0.013698630
#> [79] 0.016438356 0.019178082 0.021917808 0.024657534 0.027397260 0.030136986
#> [85] 0.032876712 0.035616438 0.038356164 0.041095890 0.043835616 0.046575342
#> [91] 0.049315068 0.052054795 0.054794521 0.057534247 0.060273973 0.063013699
#> [97] 0.065753425 0.068493151 0.071232877 0.073972603 0.076712329 0.079452055
#> [103] 0.082191781 0.084931507 0.087671233 0.090410959 0.093150685 0.095890411
#> [109] 0.098630137 0.101369863 0.104109589 0.106849315 0.109589041 0.112328767
#> [115] 0.115068493 0.117808219 0.120547945 0.123287671 0.126027397 0.128767123
#> [121] 0.131506849 0.134246575 0.136986301 0.139726027 0.142465753 0.145205479
#> [127] 0.147945205 0.150684932 0.153424658 0.156164384 0.158904110 0.161643836
#> [133] 0.164383562 0.164383562 0.169863014 0.172602740 0.175342466 0.178082192
#> [139] 0.180821918 0.183561644 0.186301370 0.189041096 0.191780822 0.194520548
#> [145] 0.197260274 0.200000000 0.202739726 0.205479452 0.208219178 0.210958904
#> [151] 0.213698630 0.216438356 0.219178082 0.221917808 0.224657534 0.227397260
#> [157] 0.230136986 0.232876712 0.235616438 0.238356164 0.241095890 0.243835616
#> [163] 0.246575342 0.249315068 0.249315068 0.254794521 0.257534247 0.260273973
#> [169] 0.263013699 0.265753425 0.268493151 0.271232877 0.273972603 0.276712329
#> [175] 0.279452055 0.282191781 0.284931507 0.287671233 0.290410959 0.293150685
#> [181] 0.295890411 0.298630137 0.301369863 0.304109589 0.306849315 0.309589041
#> [187] 0.312328767 0.315068493 0.317808219 0.320547945 0.323287671 0.326027397
#> [193] 0.328767123 0.331506849 0.331506849 0.336986301 0.339726027 0.342465753
#> [199] 0.345205479 0.347945205 0.350684932 0.353424658 0.356164384 0.358904110
#> [205] 0.361643836 0.364383562 0.367123288 0.369863014 0.372602740 0.375342466
#> [211] 0.378082192 0.380821918 0.383561644 0.386301370 0.389041096 0.391780822
#> [217] 0.394520548 0.397260274 0.400000000 0.402739726 0.405479452 0.408219178
#> [223] 0.410958904 0.413698630 0.416438356 0.416438356 0.421917808 0.424657534
#> [229] 0.427397260 0.430136986 0.432876712 0.435616438 0.438356164 0.441095890
#> [235] 0.443835616 0.446575342 0.449315068 0.452054795 0.454794521 0.457534247
#> [241] 0.460273973 0.463013699 0.465753425 0.468493151 0.471232877 0.473972603
#> [247] 0.476712329 0.479452055 0.482191781 0.484931507 0.487671233 0.490410959
#> [253] 0.493150685 0.495890411 0.498630137 0.498630137 0.504109589 0.506849315
#> [259] 0.509589041 0.512328767 0.515068493 0.517808219 0.520547945 0.523287671
#> [265] 0.526027397 0.528767123 0.531506849 0.534246575 0.536986301 0.539726027
#> [271] 0.542465753 0.545205479 0.547945205 0.550684932 0.553424658 0.556164384
#> [277] 0.558904110 0.561643836 0.564383562 0.567123288 0.569863014 0.572602740
#> [283] 0.575342466 0.578082192 0.580821918 0.583561644 0.583561644 0.589041096
#> [289] 0.591780822 0.594520548 0.597260274 0.600000000 0.602739726 0.605479452
#> [295] 0.608219178 0.610958904 0.613698630 0.616438356 0.619178082 0.621917808
#> [301] 0.624657534 0.627397260 0.630136986 0.632876712 0.635616438 0.638356164
#> [307] 0.641095890 0.643835616 0.646575342 0.649315068 0.652054795 0.654794521
#> [313] 0.657534247 0.660273973 0.663013699 0.665753425 0.668493151 0.668493151
#> [319] 0.673972603 0.676712329 0.679452055 0.682191781 0.684931507 0.687671233
#> [325] 0.690410959 0.693150685 0.695890411 0.698630137 0.701369863 0.704109589
#> [331] 0.706849315 0.709589041 0.712328767 0.715068493 0.717808219 0.720547945
#> [337] 0.723287671 0.726027397 0.728767123 0.731506849 0.734246575 0.736986301
#> [343] 0.739726027 0.742465753 0.745205479 0.747945205 0.750684932 0.750684932
#> [349] 0.756164384 0.758904110 0.761643836 0.764383562 0.767123288 0.769863014
#> [355] 0.772602740 0.775342466 0.778082192 0.780821918 0.783561644 0.786301370
#> [361] 0.789041096 0.791780822 0.794520548 0.797260274 0.800000000 0.802739726
#>
#> $month
#> [1] 10 10 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 11 11 11 11
#> [26] 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12
#> [51] 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 1
#> [76] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
#> [101] 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
#> [126] 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
#> [151] 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4
#> [176] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5
#> [201] 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
#> [226] 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6
#> [251] 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7
#> [276] 7 7 7 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8
#> [301] 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9
#> [326] 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 10 10 10
#> [351] 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10
#>
#> $year
#> [1] 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022
#> [16] 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022
#> [31] 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022
#> [46] 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022
#> [61] 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2022 2023
#> [76] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [91] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [106] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [121] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [136] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [151] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [166] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [181] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [196] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [211] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [226] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [241] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [256] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [271] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [286] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [301] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [316] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [331] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [346] 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023 2023
#> [361] 2023 2023 2023 2023 2023 2023
#>
#> $dec_time
#> [1] 2022.803 2022.805 2022.808 2022.811 2022.814 2022.816 2022.819 2022.822
#> [9] 2022.825 2022.827 2022.830 2022.833 2022.836 2022.836 2022.841 2022.844
#> [17] 2022.847 2022.849 2022.852 2022.855 2022.858 2022.860 2022.863 2022.866
#> [25] 2022.868 2022.871 2022.874 2022.877 2022.879 2022.882 2022.885 2022.888
#> [33] 2022.890 2022.893 2022.896 2022.899 2022.901 2022.904 2022.907 2022.910
#> [41] 2022.912 2022.915 2022.918 2022.918 2022.923 2022.926 2022.929 2022.932
#> [49] 2022.934 2022.937 2022.940 2022.942 2022.945 2022.948 2022.951 2022.953
#> [57] 2022.956 2022.959 2022.962 2022.964 2022.967 2022.970 2022.973 2022.975
#> [65] 2022.978 2022.981 2022.984 2022.986 2022.989 2022.992 2022.995 2022.997
#> [73] 2023.000 2023.003 2023.005 2023.008 2023.011 2023.014 2023.016 2023.019
#> [81] 2023.022 2023.025 2023.027 2023.030 2023.033 2023.036 2023.038 2023.041
#> [89] 2023.044 2023.047 2023.049 2023.052 2023.055 2023.058 2023.060 2023.063
#> [97] 2023.066 2023.068 2023.071 2023.074 2023.077 2023.079 2023.082 2023.085
#> [105] 2023.088 2023.090 2023.093 2023.096 2023.099 2023.101 2023.104 2023.107
#> [113] 2023.110 2023.112 2023.115 2023.118 2023.121 2023.123 2023.126 2023.129
#> [121] 2023.132 2023.134 2023.137 2023.140 2023.142 2023.145 2023.148 2023.151
#> [129] 2023.153 2023.156 2023.159 2023.162 2023.164 2023.164 2023.170 2023.173
#> [137] 2023.175 2023.178 2023.181 2023.184 2023.186 2023.189 2023.192 2023.195
#> [145] 2023.197 2023.200 2023.203 2023.205 2023.208 2023.211 2023.214 2023.216
#> [153] 2023.219 2023.222 2023.225 2023.227 2023.230 2023.233 2023.236 2023.238
#> [161] 2023.241 2023.244 2023.247 2023.249 2023.249 2023.255 2023.258 2023.260
#> [169] 2023.263 2023.266 2023.268 2023.271 2023.274 2023.277 2023.279 2023.282
#> [177] 2023.285 2023.288 2023.290 2023.293 2023.296 2023.299 2023.301 2023.304
#> [185] 2023.307 2023.310 2023.312 2023.315 2023.318 2023.321 2023.323 2023.326
#> [193] 2023.329 2023.332 2023.332 2023.337 2023.340 2023.342 2023.345 2023.348
#> [201] 2023.351 2023.353 2023.356 2023.359 2023.362 2023.364 2023.367 2023.370
#> [209] 2023.373 2023.375 2023.378 2023.381 2023.384 2023.386 2023.389 2023.392
#> [217] 2023.395 2023.397 2023.400 2023.403 2023.405 2023.408 2023.411 2023.414
#> [225] 2023.416 2023.416 2023.422 2023.425 2023.427 2023.430 2023.433 2023.436
#> [233] 2023.438 2023.441 2023.444 2023.447 2023.449 2023.452 2023.455 2023.458
#> [241] 2023.460 2023.463 2023.466 2023.468 2023.471 2023.474 2023.477 2023.479
#> [249] 2023.482 2023.485 2023.488 2023.490 2023.493 2023.496 2023.499 2023.499
#> [257] 2023.504 2023.507 2023.510 2023.512 2023.515 2023.518 2023.521 2023.523
#> [265] 2023.526 2023.529 2023.532 2023.534 2023.537 2023.540 2023.542 2023.545
#> [273] 2023.548 2023.551 2023.553 2023.556 2023.559 2023.562 2023.564 2023.567
#> [281] 2023.570 2023.573 2023.575 2023.578 2023.581 2023.584 2023.584 2023.589
#> [289] 2023.592 2023.595 2023.597 2023.600 2023.603 2023.605 2023.608 2023.611
#> [297] 2023.614 2023.616 2023.619 2023.622 2023.625 2023.627 2023.630 2023.633
#> [305] 2023.636 2023.638 2023.641 2023.644 2023.647 2023.649 2023.652 2023.655
#> [313] 2023.658 2023.660 2023.663 2023.666 2023.668 2023.668 2023.674 2023.677
#> [321] 2023.679 2023.682 2023.685 2023.688 2023.690 2023.693 2023.696 2023.699
#> [329] 2023.701 2023.704 2023.707 2023.710 2023.712 2023.715 2023.718 2023.721
#> [337] 2023.723 2023.726 2023.729 2023.732 2023.734 2023.737 2023.740 2023.742
#> [345] 2023.745 2023.748 2023.751 2023.751 2023.756 2023.759 2023.762 2023.764
#> [353] 2023.767 2023.770 2023.773 2023.775 2023.778 2023.781 2023.784 2023.786
#> [361] 2023.789 2023.792 2023.795 2023.797 2023.800 2023.803
#>