Skip to content

Commit

Permalink
Merge pull request #236 from olivroy/upkeep
Browse files Browse the repository at this point in the history
Upkeep
  • Loading branch information
mdancho84 committed Sep 29, 2023
2 parents b0a9612 + 49a312e commit b05e5e2
Show file tree
Hide file tree
Showing 257 changed files with 4,530 additions and 15,409 deletions.
2 changes: 0 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
^data-raw$
^README\.Rmd$
^README-.*\.png$
^\.travis\.yml$
^cran-comments\.md$
^revdep$
img
^logo\.png$
^_pkgdown\.yml$
^index\.Rmd$
^docs$
^appveyor\.yml$
^doc$
^Meta$
^CRAN-RELEASE$
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
#
# NOTE: This workflow is overkill for most R packages and
# check-standard.yaml is likely a better choice.
# usethis::use_github_action("check-standard") will install it.
on:
schedule:
- cron: '0 0 1 * *'
push:
branches: [main, master]
pull_request:
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
tags: ['*']
pull_request:
branches: [main, master]
release:
types: [published]
workflow_dispatch:

name: pkgdown

Expand All @@ -15,6 +19,8 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
issue_comment:
Expand All @@ -14,9 +14,9 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -26,10 +26,12 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: roxygen2
extra-packages: any::roxygen2
needs: pr-document

- name: Document
run: Rscript -e 'roxygen2::roxygenise()'
run: roxygen2::roxygenise()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -38,7 +40,7 @@ jobs:
git add man/\* NAMESPACE
git commit -m 'Document'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -49,19 +51,21 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/pr-fetch@v1
- uses: r-lib/actions/pr-fetch@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("styler")'
run: install.packages("styler")
shell: Rscript {0}

- name: Style
run: Rscript -e 'styler::style_pkg()'
run: styler::style_pkg()
shell: Rscript {0}

- name: commit
run: |
Expand All @@ -70,6 +74,6 @@ jobs:
git add \*.R
git commit -m 'Style'
- uses: r-lib/actions/pr-push@v1
- uses: r-lib/actions/pr-push@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
28 changes: 24 additions & 4 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
Expand All @@ -15,16 +15,36 @@ jobs:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: covr::codecov()
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
26 changes: 11 additions & 15 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
Package: tidyquant
Type: Package
Title: Tidy Quantitative Financial Analysis
Version: 1.0.7
Version: 1.0.7.9000
Authors@R: c(
person("Matt", "Dancho", email = "mdancho@business-science.io", role = c("aut", "cre")),
person("Davis", "Vaughan", email = "dvaughan@business-science.io", role = c("aut"))
)
Maintainer: Matt Dancho <mdancho@business-science.io>
Description: Bringing business and financial analysis to the 'tidyverse'. The 'tidyquant'
package provides a convenient wrapper to various 'xts', 'zoo', 'quantmod', 'TTR'
and 'PerformanceAnalytics' package
functions and returns the objects in the tidy 'tibble' format. The main
advantage is being able to use quantitative functions with the 'tidyverse'
functions including 'purrr', 'dplyr', 'tidyr', 'ggplot2', 'lubridate', etc. See
the 'tidyquant' website for more information, documentation and examples.
URL: https://github.com/business-science/tidyquant
URL: https://business-science.github.io/tidyquant/, https://github.com/business-science/tidyquant
BugReports: https://github.com/business-science/tidyquant/issues
License: MIT + file LICENSE
Encoding: UTF-8
Expand All @@ -26,38 +25,35 @@ Depends:
quantmod (>= 0.4-13)
Imports:
dplyr (>= 1.0.0),
ggplot2,
jsonlite,
ggplot2 (>= 3.4.0),
jsonlite,
httr,
curl,
curl,
lazyeval,
magrittr,
purrr,
Quandl,
riingo,
readr,
readr,
readxl,
alphavantager (>= 0.1.2),
stringr,
tibble,
tidyr (>= 1.0.0),
timetk (>= 2.4.0),
timeDate,
TTR,
xts,
rlang,
tidyverse,
tidyselect
rlang
Suggests:
alphavantager (>= 0.1.2),
Quandl,
riingo,
tibbletime,
forcats,
broom,
knitr,
forcats,
rmarkdown,
testthat (>= 2.1.0),
scales,
Rblpapi,
covr,
janitor
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
Expand Down
14 changes: 5 additions & 9 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,12 @@ export(tq_transmute_xy_)
import(PerformanceAnalytics)
import(lubridate)
import(quantmod)
importFrom(Quandl,"Quandl")
importFrom(Quandl,"Quandl.api_key")
importFrom(Quandl,"Quandl.datatable")
importFrom(Quandl,"Quandl.search")
importFrom(TTR,"SMA")
importFrom(TTR,SMA)
importFrom(ggplot2,`%+replace%`)
importFrom(magrittr,"%$%")
importFrom(magrittr,"%>%")
importFrom(rlang,":=")
importFrom(utils,"data")
importFrom(utils,"download.file")
importFrom(utils,"read.csv")
importFrom(xts,"to.period")
importFrom(rlang,.data)
importFrom(utils,download.file)
importFrom(utils,read.csv)
importFrom(xts,to.period)
13 changes: 12 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# tidyquant (development version)

- Remove the dependency on tidyverse
- tidyquant no longer loads lubridate as tidyverse 2.0 now loads lubridate
- Changed the `size` argument to `linewidth` for ggplot2 3.4.0
- Removed the last tidyr and dplyr deprecated functions
- Add linewidth = to `geom_ma()`
- Move Quandl, riingo, and alphavantager to Suggests. tidyquant will not explictly install those, but you can install them from CRAN.
- Fixed CRAN alias
- FB to META change in `FANG`

# tidyquant 1.0.7

- Moved `tidyverse` from suggest to imports to pass cran tests
Expand Down Expand Up @@ -238,7 +249,7 @@ _[Potential Breaking Change] Move `tidyverse` to suggests_
* 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 `tidyquant` users!
* New data:
* `tq_exchange()` gets the stock list for NASDAQ, NYSE, and AMEX exchanges. Use `tq_exchange_options()` to exchange options.
* `FANG` data set that can be loaded with `data(FANG)`.
* `FANG` data 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.
Expand Down
7 changes: 4 additions & 3 deletions R/api-alphavantager.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' Set Alpha Vantage API Key
#'
#' Requires the alphavantager packager to use.
#' @param api_key Optionally passed parameter to set Alpha Vantage `api_key`.
#'
#' @return Returns invisibly the currently set `api_key`
Expand All @@ -14,15 +15,15 @@
#' @examples
#'
#' \dontrun{
#' if (rlang::is_installed("alphavantager")) {
#' av_api_key(api_key = "foobar")
#' }
#' }
#'
#' @name av_api_key
#' @export
av_api_key <- function(api_key) {
if(!requireNamespace("alphavantager", quietly = TRUE)) {
stop("alphavantager must be installed to use this functionality.", call. = FALSE)
}
rlang::check_installed("alphavantager", "to use the alphavantager API.")
alphavantager::av_api_key(api_key)
}

Expand Down
9 changes: 6 additions & 3 deletions R/api-quandl.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
#' @examples
#'
#' \dontrun{
#' if (rlang::is_installed("Quandl")) {
#' quandl_api_key(api_key = "foobar")
#' }
#' }
NULL

#' @rdname quandl_api_key
#' @export
quandl_api_key <- function(api_key) {
rlang::check_installed("Quandl")

if (!missing(api_key)) {
options(Quandl.api_key = api_key)
Expand All @@ -45,7 +48,7 @@ quandl_api_key <- function(api_key) {
#'
#' @export
#'
#' @examples
#' @examplesIf rlang::is_installed("Quandl")
#'
#' \dontrun{
#' quandl_search(query = "oil")
Expand All @@ -55,8 +58,8 @@ NULL
#' @rdname quandl_search
#' @export
quandl_search <- function(query, silent = FALSE, per_page = 10, ...) {

Quandl.search(query = query, silent = silent, per_page = per_page, ...) %>%
rlang::check_installed("Quandl")
Quandl::Quandl.search(query = query, silent = silent, per_page = per_page, ...) %>%
tibble::as_tibble()

}
9 changes: 3 additions & 6 deletions R/api-tiingo.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' Set Tiingo API Key
#'
#' Requires the riingo package to be installled.
#' @param api_key Optionally passed parameter to set Tiingo `api_key`.
#'
#' @return Returns invisibly the currently set `api_key`
Expand All @@ -9,15 +10,11 @@
#' @seealso [tq_get()] `get = "tiingo"`
#'
#'
#' @export
#'
#' @examples
#'
#' @examplesIf rlang::is_installed("riingo")
#' \dontrun{
#' tiingo_api_key(api_key = "foobar")
#' tiingo_api_key(api_key = "foobar")
#' }
#'
#' @name tiingo_api_key
#' @export
tiingo_api_key <- function(api_key) {
if(!requireNamespace("riingo", quietly = TRUE)) {
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Stock prices for the "FANG" stocks.
#'
#' A dataset containing the daily historical stock prices for the "FANG" tech stocks,
#' "FB", "AMZN", "NFLX", and "GOOG", spanning from the beginning of
#' "META", "AMZN", "NFLX", and "GOOG", spanning from the beginning of
#' 2013 through the end of 2016.
#'
#' @format A "tibble" ("tidy" data frame) with 4,032 rows and 8 variables:
Expand Down

0 comments on commit b05e5e2

Please sign in to comment.