tidyquant 1.0.9
CRAN release: 2024-09-02
New Function:
-
tq_fund_holdings(): Retrieves the fund holdings and compositions for a fund and source combination. Example:tq_fund_holdings("SPY", source = "SSGA")#250
Fixes and Improvements:
- Fixes to CRAN’s API policy #249:
“Packages which use Internet resources should fail gracefully with an informative message if the resource is not available or has changed (and not give a check warning nor error).”
tidyquant 1.0.8
CRAN release: 2024-08-19
Breaking changes
-
tidyquant no longer loads lubridate. (@olivroy, #237)
If you use tidyquant with tidyverse, there is no change for you.
tidyquant no longer loads many packages on load.
Fixes
- tidyquant startup messages mimics the tidyverse messages for clarity. (@olivroy, #163, #116)
- Remove the dependency on tidyverse (@olivroy, #236)
- tidyquant no longer loads lubridate as tidyverse 2.0 now loads lubridate.
- Changed the
sizeargument tolinewidthfor ggplot2 3.4.0 - Removed the last tidyr and dplyr deprecated functions.
- Add
linewidthtogeom_ma() - Move
Quandl,riingo, andalphavantagerto Suggests. tidyquant will not explicitly install those, but you can install them from CRAN. - Fixed CRAN package alias
- FB to META change in
FANG -
geom_bbands(),geom_candlestick(), andgeom_barchart()no longer emit dropped aesthetics warnings. (@olivroy, #235)
tidyquant 1.0.5
CRAN release: 2022-09-08
- FIX: FB to META name change
- IMPROVEMENT:
sp_index()to convert symbols from “BRK.B” to “BRK-B” to work with Yahoo Finance
tidyquant 1.0.4
CRAN release: 2022-05-20
CRAN requested fixes:
- Moved
janitorto suggests - Reduced file size by removing vignettes from CRAN version.
Other changes:
- Removed the package start-up message
tidyquant 1.0.2
CRAN release: 2020-10-21
Fixes
-
tq_exchange(): Fix issue with NASDAQ changes to website. -
theme_tq(): Fix issues with%+replace%,theme_gray, andrelnot found.
tidyquant 1.0.1
CRAN release: 2020-07-02
Improvements
-
tq_get()- Add"dividends"and"splits"get options, which have been fixed inquantmod0.4-16. Issue 150.
Bug Fixes
- Issue 157 - Error on package load with
rstudioapi::getThemeInfo()returnsNULL. -
pivot_table- Fix issues withtidyversefunctions not being found.
Deprecation
-
summarise_by_time()- This function has moved totimetk::summarise_by_time()
tidyquant 1.0.0
CRAN release: 2020-03-04
This is the “R for Excel Users” release. My aim is to build functionality that helps users coming from an Excel Background (background I came from). It’s important to have these users feel at home. I have a full suite of functionality to accomplish your Excel-to-R transition.
-Matt
-
Excel Functions
-
Why Excel functions? Designed to help users coming from an Excel Background more easily transition to the
tidyverseand “tidy- finance / business analysis” in R. -
Pivot Table
-
pivot_table()- A tidyverse-style function to perform data summarizations just like the popular Excel Pivot Table. Enables stacking calculations using a tidy-esque syntax:.rows = ~ YEAR(order_date).
-
-
Reference Functions
-
VLOOKUP()- Performs the classic Excel VLOOKUP. Excel user’s: rejoice.
-
-
Summarising “IFS” Functions
-
Summarising “IFS” Functions - Filtering versions of Excel summarization counterparts. Simply add “cases” that filter if a condition is true.
SUM_IFS(),COUNT_IFS(),AVERAGE_IFS() -
Create your own “IFS” functions - Have and idea for a new “IFS” function that hasn’t been made yet? Use
CREATE_IFS()to make your own by supplying a summarization function.
-
Summarising “IFS” Functions - Filtering versions of Excel summarization counterparts. Simply add “cases” that filter if a condition is true.
-
Statistical, Date, and Financial Math Functions
- 100+ Excel-based statistical, date, and financial math functions. Names are similar to Excel function names. By default, missing values are ignored (same as in Excel).
-
Summarizations Functions -
SUM(),AVERAGE(),COUNT(), and friends. -
Transformation Functions -
CHANGE(),PCT_CHANGE(),LAG(),CUMULATIVE_SUM(), and friends. -
Date and Date Time Functions
- Integrated date calculations with
lubridate()(e.g.AS_DATE(),YEAR()) - Holidays and business calendars with
timeDate(e.g.HOLIDAY_SEQUENCE(),HOLIDAY_LIST()) - Excel Date Math functions:
NET_WORKDAYS(),EOMONTH()
- Integrated date calculations with
-
Financial Math Functions -
NPV(),IRR(),FV(),PV(),PMT(),RATE()
-
Why Excel functions? Designed to help users coming from an Excel Background more easily transition to the
-
NEW tidyverse Functionality
-
summarise_by_time()- This is a new time-based variant ofsummarise()that allows collapsing the time-series by “day”, “week”, “month”, “quarter”, “year”, and more. - Note: I will evaluate the need for
summarise_at_by_time(),summarise_all_by_time(), andsummarise_if_by_time()after the release ofdplyrv1.0.0.
-
-
NEW API Integrations
-
Tiingo API - A popular Open-Source for stock prices, cryptocurrencies, and intraday feeds from the IEX (Investors Exchange). This can serve as an alternate source of data to Yahoo Finance. Integrated via the
riingopackage.
-
Tiingo API - A popular Open-Source for stock prices, cryptocurrencies, and intraday feeds from the IEX (Investors Exchange). This can serve as an alternate source of data to Yahoo Finance. Integrated via the
-
Bug Fixes & Improvements
-
theme_tq()- Fix issues with collisions withdials::margin()andggplot2::margin(). Similar potentialggplot2collisions have been fixed. -
theme_tq()- Increased default top/bottom text margin on facet strips
-
-
Deprecation & Breaking Changes
-
Potential Breaking Change - Single values now return the symbol column (i.e.
tq_get("AAPL")returns symbol = “AAPL” for the 1st column). -
Deprecated Sources: The following sources have been deprecated due to lack of support from the API:
- Google Finance
- Morningstar Key Ratios & Financials (Fundamentals) Data
- Yahoo Dividends and Splits
- Oanda FX and Metal Prices
-
Deprecated Compound Getters - Stacking multiple get options (
tq_get("AAPL", get = c("stock.prices", "stock.prices.japan"))) is no longer available. Solution: Split these up into two calls totq_get().
-
Potential Breaking Change - Single values now return the symbol column (i.e.
tidyquant 0.5.9
CRAN release: 2019-12-15
-
tq_index()- Fix issue #144 -
tq_index()download issue. Note that “RUSSEL1000”, “RUSSELL2000”, “RUSSELL3000”, and “SP1000” are no longer available due to changes from www.us.spdrs.com. - Update Stock Index Fallback.
- Fix issue #144 -
tidyquant 0.5.8
CRAN release: 2019-10-11
-
tq_index()- Fix naming issue with stock index data downloaded from www.us.spdrs.com.
tidyquant 0.5.7
CRAN release: 2019-09-20
Stock Index & Exchanges
-
tq_exchange()- Fix NASDAQ URL change Issue #138.
Visualizations & Color Palettes
-
geom_candlestickandgeom_barchart- Issue #112. - Added color names of
theme_tqpalettes (palette_light,palette_dark, andpalette_green) for easier identification.
Compatibility with tidyr v1.0.0
- Improvements to ensure compatibility with
tidyrv1.0.0
[Potential Breaking Change] Move tidyverse to suggests
- This is actually potentially a “breaking change” (although most users will see no difference since you likely load
tidyversein your scripts) - if you do not loadtidyverse, then you will now need to do so. Previouslytidyquantloadedtidyversebehind the scenes.
tidyquant 0.5.5
CRAN release: 2018-05-09
-
Bux fix
tq_get()get = "financials"now returns a warning andNAas Google Finance no longer provides data. We are actively looking for alternative data sources.tq_get()get = "stock.prices.google"now returns a warning andNAas Google Finance no longer provides data. Useget = "stock.prices"instead to use Yahoo Finance, or use theriingopackage to download from Tiingo.Catch duplicate names in
col_renamewhen you are renaming more than 1 column. Duplicate names are not allowed and return an error.Fix duplicate name collision issue when the original name already includes a
.. Duplicate names now get a..1,..2, etc. as opposed to.1,.2.
tidyquant 0.5.4
CRAN release: 2018-02-19
- Features:
- Incorporate
alphavantager, a lightweight API to the Alpha Vantage financial data provider. - Integrate
Rblpapi, R interface to “Bloomberg”. You must have a Bloomberg account to use this. - Add Google Finance as a source in
tq_get(get = "stock.prices.google")
- Incorporate
- Important Changes:
- Remove Key Statistics from
tq_get(get = "key.stats"). Yahoo Finance no longer supports the Key Statistics CSV API. - Completed deprecation of
tidyquant::as_tibble()andtidyquant::as_xts(). Usetimetk::tk_tbl()andtimetk::tk_xts()instead. -
tibbletimesupport was added so that alltidyquantfunctions play nicely withtbl_timeobjects. - A hard dependency on
XLConnectwas removed. This should ease the use of the package, especially for Mac users.
- Remove Key Statistics from
- Bug Fixes:
- Some tests failed with
testthat2.0. They have been updated.
- Some tests failed with
tidyquant 0.5.2
CRAN release: 2017-07-27
- Incorporated more robust
timetkcoercion functions. Deprecatedtidyquant::as_xts()andtidyquant::as_tibble(). Usetimetk::tk_xts()andtimetk::tk_tbl()instead. - Fixes:
-
tq_index()no longer pulls from marketvolume. Instead, 9 indices are available from SPDR. These indices are more reliable, and include weights for each stock in the index. - Fixed 2 tests where the results of
tq_get(get = "stock.prices")were 1 or 2 rows off of what the tests expected. This likely has to do with the new yahoo finance API.
-
tidyquant 0.5.1
CRAN release: 2017-04-24
- Improvements
- Added
pkgdownintegration.
- Added
- Fixes:
- Require new
quantmodversion 0.4-8 to fix Oanda and Yahoo bugs. - Quandl data returned newest to oldest. For consistency with other
tq_get()data, it now returns oldest to newest. - Oanda only returns 180 days of FX and Metals data now. Updated the tests to account for this. Also added error handling to check for valid date ranges.
- Fixed bug with
tq_portfolio()whereweights = NULLwould not execute an equal weighting scheme. - Added error handling during dollar and percent conversion for get = “key.ratios” and get = “key.stats”.
- Require new
tidyquant 0.5.0
CRAN release: 2017-04-03
- New Data:
- Quandl Integration:
-
tq_get(get = "quandl")is a wrapper forQuandl::Quandl()that pulls multiple Quandl Codes in a “tidy” fashion. -
tq_get(get = "quandl.datatable")is a wrapper forQuandl::Quandl.datable()that pulls Quandl datatables. -
quandl_api_key()is a wrapper forQuandl::Quandl.api_key(). -
quandl_searchis a wrapper forQuandl::Quandl.search().
-
- Yahoo Japan Integration:
tq_get(get = "stock.prices.japan")is a wrapper forquantmod::getSymbols(src = "yahooj")that enables getting stocks from Yahoo Finance Japan.
- Quandl Integration:
- Improvements and Fixes:
-
tq_mutate()andtq_transmute()now accept non-OHLC data through theselectargument. They also now work withrollapply. -
tq_mutate()andtq_transmute()now acceptPerformanceAnalyticsfunctions that work to clean and transform asset returns. - Deprecated the
ohlc_funargument to instead useselectintq_mutate()andtq_transmute -
.Deprecated->.Defunctfortq_transform()andtq_transform_xy(). Usetq_transmute()andtq_transmute_xy(). Move the sign post functions to deprecated.R - Remove the previously deprecated argument,
transform_funfromtq_transmute(). Usemutate_funinstead. - Fix issue with
tq_mutatereturning rows incorrectly sorted - Fix issue with
tq_getreturning data frames as nested - Fix
tq_geterror to return full error when issues are present.
-
tidyquant 0.4.0
CRAN release: 2017-03-03
- New Features:
-
tq_transmute()replacestq_transform()for consistency withdplyr. -
tq_performance()which integrates the performance analysis functions ofPerformanceAnalytics. -
tq_portfolio()which enables aggregating portfolios from individual stock returns. -
tq_tranform(): Added the NA-handling functions fromzooto the list of compatible, which provide a number of useful methods for handlingNAvalues in data sets. AddedReturn.calculateandReturn.excessfor calculating returns and returns in excess of the risk-free rate, respectively.
-
- Documentation:
-
tq_mutate()andtq_transmute()help pages have been combined. - Split introduction into four separate vignettes, which improves flow and enables readers to more easily get to needed documentation. Now five docs total covering the primary needs of
tidyquantusers!
-
- New data:
-
tq_exchange()gets the stock list for NASDAQ, NYSE, and AMEX exchanges. Usetq_exchange_options()to exchange options. -
FANGdata set
-
- New visualizations that integrate with
ggplot2:-
palette_()functions used to create scales are exported. -
theme_tq()creates light, dark, and green themes for tidyquant visualizations. -
scale_color_tq()andscale_fill_tq()add color/fill scales for the data used in tidyquant visualizations.
-
- Improvements and Fixes:
- The
transform_funargument oftq_transmute()has been replaced withmutate_funfor consistency withtq_mutate(). - Core functions are now generics to allow for extendability.
- Issue #11: Part 2. Fix multiple stocks that only return 110 lines. Handle stocks that return csv with “We’re sorry” message.
- Issue #11: Part 1. Fix instability with
get = key.ratiosfailing with HTTP 500 error on download. Use httr RETRY in case of failure. - Fixed issue with
get = "key.ratios"where stocks listed on AMEX exchange were not able to return key ratios. - Issue #9: Fix problem with
get = "key.stats"where NA’s in multiplex(e.g.c("AAPL", "GOOG")) cause call to fail during coercion. - Issue #8, Part 2: Enable compound gets (e.g.
tq_get("AAPL", get = c("stock.prices", "financials"))). - Issue #8, Part 1: Create
tq_index()function to return a stock index.tq_get(get = "stock.index")is deprecated and will be removed during the next version after 0.4.0. Usetq_index_options()for index options. - Issue #7: Fixed issue with date column inadvertently being coerced to
dttm.
- The
tidyquant 0.3.0
CRAN release: 2017-01-21
- New data:
- New
tq_getoptionget = "key.stats", which retrieves the current key statistics (55 total) from www.finance.yahoo.com/. These include various current data such as Ask, Bid, Day’s High, Day’s Low, Last Trade Price, current P/E Ratio, EPS, Current Market Cap, EPS Projected Current Year, EPS Projected Next Year and many more. Example:tq_get("AAPL", get = "key.stats").
- New
- New visualizations that integrate with
ggplot2:- Chart geoms: Bar charts (
geom_barchart) and candlestick charts (geom_candlestick) can be quickly created with the new geoms. - Moving Averages: Seven moving averages can be quickly visualized / prototyped using
geom_ma. The geom wraps theTTR::SMAfunctions. - Bollinger bands can be visualized with
geom_bbands. The same seven moving averages are compatible with the geom. - Zooming Into Chart Sections: Two functions (
coord_x_dateandcoord_x_datetime) were added to enable zooming into chart sections using dates with no out-of-bounds data loss (e.g. out-of-bounds data loss with thescale_x_functions).
- Chart geoms: Bar charts (
- New Vignette: Covers “Charting with tidyquant”.
- Fixes:
- Issue #5:
tq_getcan now accept character vectors and data frames for thexarg, in addition to a single character input. This streamlines the getting of data for multiple inputs (e.g. stock symbols, stock indexes, etc). - Issue #4: Added
col_renamearg totq_mutateandtq_transform, which enables fast and easy renaming during the operation. - Issue #3: Integrated
dplyr::group_by()withtq_mutate()andtq_transform(). The transform and mutate functions now work properly with grouped data frames. - Issue #2: Fixed bug with
tq_get(),get = "key.ratios", where key ratios for stocks from the NYSE returnedNA.
- Issue #5:
- Removed support for deprecated arguments:
x_fun,.x, and.yin the respective transform and mutate functions.
tidyquant 0.2.0
CRAN release: 2017-01-08
- New
get = "key.ratios"option fortq_get(), which retrieves 10-years of key performance ratios (89 total) from www.morningstar.com. These include various historical measures of financial performance including profitability, growth, cash flow, financial health, efficiency, and valuation ratios. Example:tq_get("AAPL", get = "key.ratios"). - Added
zoorollapply()functions to list of compatible / integrated functions used withtq_transform()andtq_mutate(). Seetq_transform_fun_options()for the full list. - Changed
tq_mutate(),tq_transform(),tq_mutate_xy()andtq_transform_xy()arguments to be more obvious:-
x_funis nowohlc_funfortq_mutate()andtq_transform() -
.xis nowxand.yis nowyfortq_mutate_xy()andtq_transform_xy()
-
- Fixed duplication of column names during
tq_mutate. Names are now sequentially indexed with duplicate names starting at.1suffix.
