Is there any function / package that can calculate the annual share (differences between the two dates) with a different daily account arrangement like yearfrac () in Matlab? I need to use the Actual / 365 agreement.
rollYourOwn <- function(D, origin=as.Date("1970-01-01")) { if (!inherits(D, "Date")) D <- as.Date(D, origin=origin) as.numeric(D - as.Date(format(D, "%Y-01-01"), origin=origin) + 1) / 365 } rollYourOwn("2014-01-01") # [1] 0.00273973 rollYourOwn(Sys.Date()) # [1] 0.742466 rollYourOwn("2014-12-31") # [1] 1
Source: https://habr.com/ru/post/975959/More articles:Transition from a vector with one dispenser to a vector with another - c ++speed up the use of streambuf and accomplish what it is - streambufJenkins problem with Xcode 6: "Code sign error: code signature identifiers not found" - objective-cNodejs: completion of an entire script in a function call - javascriptspray safety: how to protect routes? - securityiOS 8 Today the widget does not appear when the project starts - xcodeSeparate style sheets should be in the sass directory - sasshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/975962/ios-today-extension-do-not-launch-lost-connection-to-device&usg=ALkJrhjgYF8oe2IkHccbvgsFm_6zObNpTgDoes the identity function in Clojure have the same use and purpose as the id function in Haskell? - clojureCalculate PI using the sum of inverse squares - mathAll Articles