{"id":13465721,"url":"https://github.com/business-science/tidyquant","last_synced_at":"2025-10-04T06:26:26.060Z","repository":{"id":15178977,"uuid":"77705369","full_name":"business-science/tidyquant","owner":"business-science","description":"Bringing financial analysis to the tidyverse","archived":false,"fork":false,"pushed_at":"2025-04-29T09:02:09.000Z","size":183738,"stargazers_count":879,"open_issues_count":86,"forks_count":181,"subscribers_count":72,"default_branch":"master","last_synced_at":"2025-04-29T09:46:52.992Z","etag":null,"topics":["dplyr","financial-analysis","financial-data","financial-statements","multiple-stocks","performance-analysis","performanceanalytics","quantmod","r-package","stock","stock-exchanges","stock-indexes","stock-lists","stock-performance","stock-prices","stock-symbol","tidyverse","time-series","timeseries","xts"],"latest_commit_sha":null,"homepage":"https://business-science.github.io/tidyquant/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/business-science.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-12-30T19:12:30.000Z","updated_at":"2025-04-29T08:55:16.000Z","dependencies_parsed_at":"2023-09-29T23:01:42.595Z","dependency_job_id":"c88b3791-5076-4e63-81e6-7fc962b78da3","html_url":"https://github.com/business-science/tidyquant","commit_stats":{"total_commits":510,"total_committers":11,"mean_commits":46.36363636363637,"dds":"0.35686274509803917","last_synced_commit":"ae5a6ee60f58fd2fa0e4b811682601bcc5d96b0b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftidyquant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftidyquant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftidyquant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/business-science%2Ftidyquant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/business-science","download_url":"https://codeload.github.com/business-science/tidyquant/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dplyr","financial-analysis","financial-data","financial-statements","multiple-stocks","performance-analysis","performanceanalytics","quantmod","r-package","stock","stock-exchanges","stock-indexes","stock-lists","stock-performance","stock-prices","stock-symbol","tidyverse","time-series","timeseries","xts"],"created_at":"2024-07-31T15:00:34.325Z","updated_at":"2025-10-04T06:26:21.014Z","avatar_url":"https://github.com/business-science.png","language":"R","funding_links":[],"categories":["R","⚙️ Backend \u0026 APIs"],"sub_categories":["Time Series"],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE, message = FALSE, warning=F}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\",\n  dpi = 300,\n  message = F,\n  warning = F\n)\n```\n\n# tidyquant \u003cimg src=\"man/figures/logo.png\" width=\"147\" height=\"170\" align=\"right\" /\u003e\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/business-science/tidyquant/actions/workflows/R-CMD-check.yaml)\n[![Codecov](https://codecov.io/gh/business-science/tidyquant/branch/master/graph/badge.svg)](https://app.codecov.io/gh/business-science/tidyquant)\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/tidyquant)](https://cran.r-project.org/package=tidyquant)\n![](http://cranlogs.r-pkg.org/badges/tidyquant?color=brightgreen)\n![](http://cranlogs.r-pkg.org/badges/grand-total/tidyquant?color=brightgreen)\n\u003c!-- badges: end --\u003e\n\n\u003e Bringing financial and business analysis to the `tidyverse` in R.\n\nMission: 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. \n\n## Start: 2-Minutes To tidyquant\n\nOur short introduction to `tidyquant` on\n[YouTube](https://www.youtube.com/embed/woxJZTL2hok).\n\n\u003ca href=\"https://www.youtube.com/embed/woxJZTL2hok\" target=\"_blank\"\u003e\u003cimg src=\"http://img.youtube.com/vi/woxJZTL2hok/0.jpg\" alt=\"Anomalize\" width=\"100%\" height=\"350\"/\u003e\u003c/a\u003e\n\n\n\n\n# Features of tidyquant\n\n`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`. \n\n* __A few core functions with a lot of power__\n* __Integrates the quantitative analysis functionality of `zoo`, `xts`, `quantmod`, `TTR`, and _now_ `PerformanceAnalytics`__\n* __Designed for modeling and scaling analyses using the `tidyverse` tools in [_R for Data Science_](https://r4ds.hadley.nz/)__\n* __Implements `ggplot2` functionality for beautiful and meaningful financial visualizations__\n* __User-friendly documentation to get you up to speed quickly!__\n\n\n\n\n### New Excel Functionality in tidyquant \n\n - [__Excel in R - Pivot Tables, VLOOKUPs, and more__](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html): Details on the __Excel integrations__ are covered in the blog article.\n\n\n\n\n## One-Stop Shop for Serious Financial Analysis\n\nWith `tidyquant` all the benefits add up to one thing: _a one-stop shop for serious financial analysis!_\n\n\n### Core Functions\n\n* __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.  \n\n* __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.  \n\n* __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. \n\n### Comparing Stock Prices\n\nVisualizing the stock price volatility of four stocks side-by-side is quick and easy...\n\n```{r echo=FALSE, out.width='100%'}\nknitr::include_graphics(\"man/figures/sample_img_1_volatility.png\")\n```\n\n\n### Evaluating Stock Performance\n\nWhat about stock performance? Quickly visualize how a $10,000 investment in various stocks would perform.\n\n```{r echo=FALSE, out.width='100%'}\nknitr::include_graphics(\"man/figures/sample_img_2_stock_returns.png\")\n```\n\n### Evaluating Portfolio Performance\n\nOk, stocks are too easy. What about portfolios? With the `PerformanceAnalytics` integration, visualizing blended portfolios are easy too!\n\n* Portfolio 1: 50% FB, 25% AMZN, 25% NFLX, 0% GOOG\n* Portfolio 2: 0% FB, 50% AMZN, 25% NFLX, 25% GOOG\n* Portfolio 3: 25% FB, 0% AMZN, 50% NFLX, 25% GOOG\n* Portfolio 4: 25% FB, 25% AMZN, 0% NFLX, 50% GOOG\n\n```{r echo=FALSE, out.width='100%'}\nknitr::include_graphics(\"man/figures/sample_img_3_portfolio_returns.png\")\n```\n\nThis just scratches the surface of `tidyquant`. Here's how to install to get started.\n\n## Installation\n\nDevelopment Version with Latest Features:\n\n``` {r, eval = FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"business-science/tidyquant\")\n```\n\nCRAN Approved Version: \n\n```{r, eval = FALSE}\ninstall.packages(\"tidyquant\")\n```\n\n\n\n## Further Information\n\nThe `tidyquant` package includes several vignettes to help users get up to speed quickly:\n\n* [TQ00 - Introduction to `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ00-introduction-to-tidyquant.html)\n* [TQ01 - Core Functions in `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ01-core-functions-in-tidyquant.html)\n* [TQ02 - R Quantitative Analysis Package Integrations in `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ02-quant-integrations-in-tidyquant.html)\n* [TQ03 - Scaling and Modeling with `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ03-scaling-and-modeling-with-tidyquant.html)\n* [TQ04 - Charting with `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ04-charting-with-tidyquant.html)\n* [TQ05 - Performance Analysis with `tidyquant`](https://business-science.github.io/tidyquant/articles/TQ05-performance-analysis-with-tidyquant.html)\n* [Blog Article: Excel in R - Pivot Tables, VLOOKUPs, and more!](https://www.business-science.io/finance/2020/02/26/r-for-excel-users.html)\n\n\n\n# Want to Learn tidyquant?\n\n- [Learning Lab #9:](https://university.business-science.io/p/learning-labs-pro) \n  \n  - __Performance Analysis \u0026 Portfolio Optimization with `tidyquant`__ - A 1-hour course on `tidyquant` in Learning Labs PRO\n\n- [Learning Lab #10:](https://university.business-science.io/p/learning-labs-pro) \n  \n  - __Building an API with `plumber`__ - Build a stock optimization API with `plumber` and `tidyquant`\n  \n- [Learning Lab #16:](https://university.business-science.io/p/learning-labs-pro) \n  \n  - __Stock Portfolio Optimization and Nonlinear Programming__ - Use the `ROI` package with `tidyquant` to calculate optimal minimum variance portfolios and develop an efficient frontier.  \n  \n- [Learning Lab #30:](https://university.business-science.io/courses/learning-labs-pro/lectures/14630075)\n  - __Shiny Financial Analysis with Tidyquant API \u0026 Excel Pivot Tables__ - Learn how to use the new Excel Functionality to make Pivot Tables, VLOOKUPs, Sum-If's, and more!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusiness-science%2Ftidyquant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbusiness-science%2Ftidyquant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbusiness-science%2Ftidyquant/lists"}