-
Notifications
You must be signed in to change notification settings - Fork 28
/
yc_get.Rd
117 lines (104 loc) · 2.97 KB
/
yc_get.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/scraper-yc.R
\name{yc_get}
\alias{yc_get}
\alias{yc_mget}
\alias{yc_ipca_mget}
\alias{yc_ipca_get}
\alias{yc_usd_mget}
\alias{yc_usd_get}
\title{Fetches Yield Curve Data from B3}
\usage{
yc_mget(
first_date = Sys.Date() - 5,
last_date = Sys.Date(),
by = 1,
cache_folder = cachedir(),
do_cache = TRUE
)
yc_get(refdate = Sys.Date(), cache_folder = cachedir(), do_cache = TRUE)
yc_ipca_mget(
first_date = Sys.Date() - 5,
last_date = Sys.Date(),
by = 1,
cache_folder = cachedir(),
do_cache = TRUE
)
yc_ipca_get(refdate = Sys.Date(), cache_folder = cachedir(), do_cache = TRUE)
yc_usd_mget(
first_date = Sys.Date() - 5,
last_date = Sys.Date(),
by = 1,
cache_folder = cachedir(),
do_cache = TRUE
)
yc_usd_get(refdate = Sys.Date(), cache_folder = cachedir(), do_cache = TRUE)
}
\arguments{
\item{first_date}{First date ("YYYY-MM-DD") to \code{yc_mget} multiple curves}
\item{last_date}{Last date ("YYYY-MM-DD") to \code{yc_mget} multiple curves}
\item{by}{Number of days in between fetched dates (default = 1) in \code{yc_mget}}
\item{cache_folder}{Location of cache folder (default = cachedir())}
\item{do_cache}{Whether to use cache or not (default = TRUE)}
\item{refdate}{Specific date ("YYYY-MM-DD") to \code{yc_get} single curve}
}
\value{
A dataframe/tibble with yield curve data
}
\description{
Downloads yield curve data from B3 website
\url{https://www2.bmf.com.br/pages/portal/bmfbovespa/lumis/lum-taxas-referenciais-bmf-ptBR.asp}.
Particularly, we import data for
\itemize{
\item DI X Pre (\code{yc_get})
\item Cupom limpo (\code{yc_usd_get})
\item DI x IPCA (\code{yc_ipca_get})
}
}
\details{
See \url{https://www.b3.com.br/data/files/8B/F5/11/68/5391F61043E561F6AC094EA8/Manual_de_Curvas.pdf}
for more details.
\code{yc_get} returns the yield curve for the given date and \code{yc_mget} returns
multiple yield curves for a given range of dates.
\code{yc_ipca_get} returns the yield curve of real interest rates
for the given date and \code{yc_ipca_mget} returns
multiple yield curves of real interest rates for a given range of dates.
These real interest rates consider IPCA as its inflation index.
\code{yc_usd_get} returns the yield curve of nominal interest rates for USD in
Brazil for the given date and \code{yc_usd_mget} returns
multiple yield curves of nominal interest rates for USD in Brazil for a
given range of dates.
These real interest rates consider IPCA as its inflation index.
}
\examples{
\dontrun{
df_yc <- yc_mget(first_date = Sys.Date() - 5, last_date = Sys.Date())
head(df_yc)
}
\dontrun{
df_yc <- yc_get(Sys.Date())
head(df_yc)
}
\dontrun{
df_yc_ipca <- yc_ipca_mget(
first_date = Sys.Date() - 5,
last_date = Sys.Date()
)
head(df_yc_ipca)
}
\dontrun{
df_yc_ipca <- yc_ipca_get(Sys.Date())
head(df_yc_ipca)
}
\dontrun{
df_yc_usd <- yc_usd_mget(
first_date = Sys.Date() - 5,
last_date = Sys.Date()
)
head(df_yc_usd)
}
\dontrun{
df_yc_usd <- yc_usd_get(Sys.Date())
head(df_yc_usd)
}
}