R 패키지 메타데이터와 수집 신호를 모아 봅니다.
첫 화면에서 판단해야 할 수집 신호를 먼저 배치합니다.
DESCRIPTION에서 감지한 backend 관련 package입니다.
기본 메타데이터를 작은 카드와 토큰으로 압축합니다.
| Package | Type | Spec |
|---|---|---|
| ggplot2 CRAN · 0.5.2 · 2026-05-30 | Imports | ggplot2 |
| reshape2 CRAN · 0.5.2 · 2026-05-30 | Imports | reshape2 |
| scales CRAN · 0.5.2 · 2026-05-30 | Imports | scales |
| stats CRAN · 0.5.2 · 2026-05-30 | Imports | stats |
| utils CRAN · 0.5.2 · 2026-05-30 | Imports | utils |
| knitr CRAN · 0.5.2 · 2026-05-30 | Suggests | knitr |
| markdown CRAN · 0.5.2 · 2026-05-30 | Suggests | markdown |
| rmarkdown CRAN · 0.5.2 · 2026-05-30 | Suggests | rmarkdown |
| testthat CRAN · 0.5.2 · 2026-05-30 | Suggests | testthat |
| 검색 결과가 없습니다. | ||
| Type | Packages |
|---|---|
| Imports | 1 |
NEWS code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} tvm 0.4 Add year fraction and compounding arguments to both xnpv and xirr , providing greater flexibility tvm 0.3 Add vignette and NEWS Prevent negative discount factors when calculating them from swap curves Split zero rates in zero nominal and zero effective A functor argument is added to the rate_curve constructor, to allow the user to specify how the interpolation should be performed. Changing the default spline interpolation method from natural to monoH.FC , as to respect monotonicity if present Add new irregular functions, xnpv and xirrREADME code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} Package Description The tvm package aims to simplify financial calculations, involving loan payments and rates, and the transformation from discount factors to different rate types. It has two sections. The first one deals with fixed equal payment loans. There you have functions similar to PMT, RATE, etc from Excel. The second one deals with rate curves and different rates for different loan structures (zero coupon, bullet, french, german, etc). Quick Examples library(tvm) # Present values and internal rate of return calculations npv(i = 0.01, cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3)) xnpv(i = 0.01, cf = c(-1, 0.5, 0.9), d = as.Date(c("2015-01-01", "2015-02-15", "2015-04-10"))) irr(cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3)) xirr(cf = c(-1, 1.5), d = Sys.Date() + c(0, 365)) # Typical loan calculations pmt(amt = 100, maturity = 10, rate = 0.05) rate(amt = 100, maturity = 10, pmt = 15) loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet") # Get the cashflow for a loan l <- loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet") cashflow(l) # Build a rate curve from different inputs rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") rate_curve(fun_r = function(x) rep_len(0.1, length(x)), rate_type = "swap", knots = 1:10) rate_curve(fun_d = function(x) 1 / (1 + x), knots = 1:10) # Subset a rate curve, maybe transforming it to another rate type r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") r["zero_eff"] r["swap",c(1.5, 2)] # Plot a rate curve plot(r) plot(r, rate_type = "german") plot(r, rate_type = c("french", "german")) Installation instructions tvm lives on CRAN, so installation is easy with install.packages("tvm"") More Details Please read the introductory vignetteHelp for package tvm const macros = { "\\R": "\\textsf{R}", "\\mbox": "\\text", "\\code": "\\texttt"}; function processMathHTML() { var l = document.getElementsByClassName('reqn'); for (let e of l) { katex.render(e.textContent, e, { throwOnError: false, macros }); } return; } Package {tvm} Contents tvm-package [.rate_curve adjust_disc cashflow cft disc_cf disc_value find_rate irr loan npv plot.rate_curve pmt rate rate_curve rem xirr xnpv Type: Package Title: Time Value of Money Functions Version: 0.5.2 Author: Juan Manuel Truppia Maintainer: Juan Manuel Truppia <jmtruppia@gmail.com> Description: Functions for managing cashflows and interest rate curves. License: MIT + file LICENSE Depends: R (≥ 3.1.0) Suggests: testthat, knitr, markdown, rmarkdown Imports: ggplot2, reshape2, scales, stats, utils VignetteBuilder: knitr RoxygenNote: 7.2.3 Encoding: UTF-8 URL: https://bitbucket.org/juancentro/tvm NeedsCompilation: no Packaged: 2023-08-30 13:33:41 UTC; Juan Repository: CRAN Date/Publication: 2023-08-30 13:50:02 UTC tvm: Time Value of Money Functions Description Functions for managing cashflows and interest rate curves. See Also Useful links: https://bitbucket.org/juancentro/tvm Returns a particular rate or rates from a curve Description Returns a particular rate or rates from a curve Usage ## S3 method for class 'rate_curve' r[rate_type = "zero_eff", x = NULL] Arguments r The rate_curve object rate_type The rate type x The points in time to return Value If x is NULL , then returns a rate function of rate_type type. Else, it returns the rates of rate_type type and corresponding to time x Examples r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") r["zero_eff"] r["swap",c(1.5, 2)] Adjusts the discount factors by a spread Description Adjusts the discount factors by a spread Usage adjust_disc(fd, spread) Arguments fd vector of discount factors used to discount cashflows in 1:length(fd) periods spread effective spread Examples adjust_disc(fd = c(0.99, 0.98), spread = 0.01) Get the cashflow for a loan Description Returns the cashflow for the loan, excluding the initial inflow for the loan taker Usage cashflow(l) Arguments l The loan Examples l <- loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet") cashflow(l) Calculates the Total Financial Cost (CFT) Description This is the IRR of the loan's cashflow, after adding all the extra costs Usage cft(amt, maturity, rate, up_fee = 0, per_fee = 0) Arguments amt The amount of the loan maturity The maturity of the loan rate The loan rate, in effective rate up_fee The fee that the loan taker pays upfront per_fee The fee that the loan payer pays every period Details It is assumed that the loan has monthly payments The CFT is returned as an effective rate of periodicity equal to that of the maturity and the rate The interest is calculated over amt + fee Examples cft(amt = 100, maturity = 10, rate = 0.05, up_fee = 1, per_fee = 0.1) Value of a discounted cashflow Description Value of a discounted cashflow Usage disc_cf(fd, cf) Arguments fd The discount factor vector cf The cashflow Examples disc_cf(fd = c(1, 0.99, 0.98, 0.97), cf = c(1, -0.3, -0.4, -0.6)) Calculates the present value of a cashflow Description Calculates the present value of a cashflow Usage disc_value(r, cf, d = 1:length(cf)) Arguments r A rate curve cf The vector of values corresponding to the cashflow d The periods on which the cashflow occurs. If missing, it is assumed that cf[i] occurs on period i Value The present value of the cashflow Examples r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") disc_value(r, cf = c(-1, 1.10), d = c(0,1)) disc_value(r, cf = c(-1, 1.15*1.15), d = c(0,2)) Find the rate for a loan given the discount factors Description Thru a root finding process, this function finds the rate that corresponds to a given set of discount factors, as for the loan to have the same present value discounted with the discount factors or with that constant rate Usage find_rate(m, d, loan_type, interval = c(1e-06, 2), tol = 1e-08) Arguments m The maturity of the loan d The discount factor vector loan_type One of the loan types interval The interval for the root finding process tol The tolerance for the root finding process Examples find_rate(m = 3, d = c(0.99, 0.98, 0.97), loan_type = "bullet") The IRR is returned as an effective rate with periodicity equal to that of the cashflow Description Internal Rate of Return of a periodic cashflow (IRR) Usage irr(cf, ts = seq(from = 0, by = 1, along.with = cf), interval = c(-1, 10), ...) Arguments cf The cashflow ts The times on which the cashflow occurs. It is assumed that cf[idx] happens at moment ts[idx] interval A length 2 vector that indicates the root finding algorithm where to search for the irr ... Other arguments to be passed on to uniroot Examples irr(cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3)) Creates an instance of a loan class Description Creates an instance of a loan class Usage loan(rate, maturity, amt, type, grace_int = 0, grace_amort = grace_int) Arguments rate The periodic effective rate of the loan maturity The maturity of the loan, measured in the same units as the periodicity of the rate amt The amount loaned type The type of loan. Available types are c("bullet","french","german") grace_int The number of periods that the loan doesn't pay interest and capitalizes it. Leave in 0 for zero loans grace_amort The number of periods that the loan doesn't amortize Examples loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet") Net Present Value of a periodic cashflow (NPV) Description Net Present Value of a periodic cashflow (NPV) Usage npv(i, cf, ts = seq(from = 0, by = 1, along.with = cf)) Arguments i The rate used to discount the cashflow. It must be effective and with a periodicity that matches that of the cashflow cf The cashflow ts The times on which the cashflow occurs. It is assumed that cf[idx] happens at moment ts[idx] . If empty, assumes that cf[idx] happens at period idx - 1 Value The net present value at Examples npv(i = 0.01, cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3)) Plots a rate curve Description Plots a rate curve Usage ## S3 method for class 'rate_curve' plot(x, rate_type = NULL, y_labs_perc = TRUE, y_labs_acc = NULL, ...) Arguments x The rate curve rate_type The rate types to plot, in c("french", "fut", "german", "zero_eff", "zero_nom", "swap", "zero_cont") y_labs_perc If TRUE, the y axe is labeled with percentages y_labs_acc If y_labs_perc is TRUE, the accuracy for the percentages (i.e., 1 for xx%, 0.1 for xx.x%, 0.01 for xx.xx%, etc) ... Other arguments (unused) Examples r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") plot(r) ## Not run: plot(r, rate_type = "german") plot(r, rate_type = c("french", "german")) ## End(Not run) The value of the payment of a loan with constant payments (french type amortization) Description The value of the payment of a loan with constant payments (french type amortization) Usage pmt(amt, maturity, rate) Arguments amt The amount of the loan maturity The maturity of the loan rate The rate of the loan Details The periodicity of the maturity and the rate must match, and this will be the periodicity of the payments Examples pmt(amt = 100, maturity = 10, rate = 0.05) The rate of a loan with constant payments (french type amortization) Description The rate of a loan with constant payments (french type amortization) Usage rate(amt, maturity, pmt, extrema = c(1e-04, 1e+09), tol = 1e-04) Arguments amt The amount of the loan maturity The maturity of the loan pmt The payments of the loan extrema Vector of length 2 that has the minimum and maximum value to search for the rate tol The tolerance to use in the root finding algorithm Details The periodicity of the maturity and the payment must match, and this will be the periodicity of the rate (which is returned as an effective rate) Examples rate(amt = 100, maturity = 10, pmt = 15) Creates a rate curve instance Description Creates a rate curve instance UReturns a particular rate or rates from a curve
[rate_curve(r, rate_type = "zero_eff", x = NULL)r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") r["zero_eff"] r["swap",c(1.5, 2)]Adjusts the discount factors by a spread
adjust_disc(fd, spread)adjust_disc(fd = c(0.99, 0.98), spread = 0.01)Returns the cashflow for the loan, excluding the initial inflow for the loan taker
cashflow(l)l <- loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet") cashflow(l)This is the IRR of the loan's cashflow, after adding all the extra costs
cft(amt, maturity, rate, up_fee = 0, per_fee = 0)cft(amt = 100, maturity = 10, rate = 0.05, up_fee = 1, per_fee = 0.1)Value of a discounted cashflow
disc_cf(fd, cf)disc_cf(fd = c(1, 0.99, 0.98, 0.97), cf = c(1, -0.3, -0.4, -0.6))Calculates the present value of a cashflow
disc_value(r, cf, d = 1:length(cf))r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") disc_value(r, cf = c(-1, 1.10), d = c(0,1)) disc_value(r, cf = c(-1, 1.15*1.15), d = c(0,2))Thru a root finding process, this function finds the rate that corresponds to a given set of discount factors, as for the loan to have the same present value discounted with the discount factors or with that constant rate
find_rate(m, d, loan_type, interval = c(1e-06, 2), tol = 1e-08)find_rate(m = 3, d = c(0.99, 0.98, 0.97), loan_type = "bullet")Internal Rate of Return of a periodic cashflow (IRR)
irr(cf, ts = seq(from = 0, by = 1, along.with = cf), interval = c(-1, 10), ...)irr(cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3))Creates an instance of a loan class
loan(rate, maturity, amt, type, grace_int = 0, grace_amort = grace_int)loan(rate = 0.05, maturity = 10, amt = 100, type = "bullet")Net Present Value of a periodic cashflow (NPV)
npv(i, cf, ts = seq(from = 0, by = 1, along.with = cf))npv(i = 0.01, cf = c(-1, 0.5, 0.9), ts = c(0, 1, 3))Plots a rate curve
plotrate_curve(x, rate_type = NULL, y_labs_perc = TRUE, y_labs_acc = NULL, ...)r <- rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") plot(r) plot(r, rate_type = "german") plot(r, rate_type = c("french", "german"))The value of the payment of a loan with constant payments (french type amortization)
pmt(amt, maturity, rate)pmt(amt = 100, maturity = 10, rate = 0.05)The rate of a loan with constant payments (french type amortization)
rate(amt, maturity, pmt, extrema = c(1e-04, 1e+09), tol = 1e-04)rate(amt = 100, maturity = 10, pmt = 15)Creates a rate curve instance
rate_curve( rates = NULL, rate_type = "zero_eff", pers = 1:length(rates), rate_scale = 1, fun_d = NULL, fun_r = NULL, knots = seq.int(from = 1, to = max(pers), by = 1), functor = function(x, y) splinefun(x = x, y = y, method = "monoH.FC") )rate_curve(rates = c(0.1, 0.2, 0.3), rate_type = "zero_eff") rate_curve(fun_r = function(x) rep_len(0.1, length(x)), rate_type = "swap", knots = 1:12) rate_curve(fun_d = function(x) 1 / (1 + x), knots = 1:12)The amount that has to be repayed at each moment in a loan, at the end of the period
rem(cf, amt, r)rem(cf = rep_len(0.4, 4), amt = 1, r = 0.2)Functions for managing cashflows and interest rate curves.
Internal Rate of Return of an irregular cashflow (IRR)
xirr(cf, d, tau = NULL, comp_freq = 1, interval = c(-0.99999, 10), ...)xirr(cf = c(-1, 1.5), d = Sys.Date() + c(0, 365))Net Present Value of an irregular cashflow (NPV)
xnpv(i, cf, d, tau = NULL, comp_freq = 1)xnpv(i = 0.01, cf = c(-1, 0.5, 0.9), d = as.Date(c("2015-01-01", "2015-02-15", "2015-04-10")))| Repository | Version | Published | First seen | Last seen | Docs |
|---|---|---|---|---|---|
| CRAN | 0.5.2 | 2026-05-29 | 2026-05-30 |
표시할 OSV 데이터가 없습니다.
표시할 OpenAlex 데이터가 없습니다.