knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%", dpi = 300, message = F, warning = F )
Bringing financial and business analysis to the
tidyverse
in R.
Mission: Our number 1 goal is to make financial analysis easier in R. We've designed tidyquant
to give you the flexibility of the tidyverse with the performance of the R xts
system. The result: easier, faster, and more scalable financial analysis.
Our short introduction to tidyquant
on
YouTube.
tidyquant
integrates the best resources for collecting and analyzing financial data, zoo
, xts
, quantmod
, TTR
, and PerformanceAnalytics
, with the tidy data infrastructure of the tidyverse
allowing for seamless interaction between each. You can now perform complete financial analyses in the tidyverse
.
zoo
, xts
, quantmod
, TTR
, and now PerformanceAnalytics
tidyverse
tools in R for Data Scienceggplot2
functionality for beautiful and meaningful financial visualizationsWith tidyquant
all the benefits add up to one thing: a one-stop shop for serious financial analysis!
Getting Financial Data from the web: tq_get()
. This is a one-stop shop for getting web-based financial data in a "tidy" data frame format. Get data for daily stock prices (historical), key statistics (real-time), key ratios (historical), financial statements, dividends, splits, economic data from the FRED, FOREX rates from Oanda.
Manipulating Financial Data: tq_transmute()
and tq_mutate()
. Integration for many financial functions from xts
, zoo
, quantmod
,TTR
and PerformanceAnalytics
packages. tq_mutate()
is used to add a column to the data frame, and tq_transmute()
is used to return a new data frame which is necessary for periodicity changes.
Performance Analysis and Portfolio Analysis: tq_performance()
and tq_portfolio()
. The newest additions to the tidyquant
family integrate PerformanceAnalytics
functions. tq_performance()
converts investment returns into performance metrics. tq_portfolio()
aggregates a group (or multiple groups) of asset returns into one or more portfolios.
Visualizing the stock price volatility of four stocks side-by-side is quick and easy...
knitr::include_graphics("man/figures/sample_img_1_volatility.png")
What about stock performance? Quickly visualize how a $10,000 investment in various stocks would perform.
knitr::include_graphics("man/figures/sample_img_2_stock_returns.png")
Ok, stocks are too easy. What about portfolios? With the PerformanceAnalytics
integration, visualizing blended portfolios are easy too!
knitr::include_graphics("man/figures/sample_img_3_portfolio_returns.png")
This just scratches the surface of tidyquant
. Here's how to install to get started.
Development Version with Latest Features:
``` {r, eval = FALSE}
devtools::install_github("business-science/tidyquant")
CRAN Approved Version: ```r install.packages("tidyquant")
The tidyquant
package includes several vignettes to help users get up to speed quickly:
tidyquant
tidyquant
tidyquant
tidyquant
tidyquant
tidyquant
Performance Analysis & Portfolio Optimization with tidyquant
- A 1-hour course on tidyquant
in Learning Labs PRO
Building an API with plumber
- Build a stock optimization API with plumber
and tidyquant
Stock Portfolio Optimization and Nonlinear Programming - Use the ROI
package with tidyquant
to calculate optimal minimum variance portfolios and develop an efficient frontier.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.