Skip to content

Commit

Permalink
Merge pull request #116 from tidy-finance/115-download_datafactors_q5…
Browse files Browse the repository at this point in the history
…_annual-does-not-work

Fix bug with `download_data("factors q5 annual")`
  • Loading branch information
christophscheuch authored Nov 18, 2024
2 parents e0e2e4c + aaa8508 commit 495d542
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: tidyfinance
Title: Tidy Finance Helper Functions
Version: 0.4.1.9002
Version: 0.4.1.9003
Authors@R: c(
person("Christoph", "Scheuch", , "christoph.scheuch@gmail.com", role = c("aut", "cre", "cph"),
comment = c(ORCID = "0009-0004-0423-6819")),
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Improvements

* Updated `ccmxpf_linktable` to the new WRDS default `ccmxpf_lnkhist`.
* Added support for "factors_q5_annual" in `download_factors_q()`

# tidyfinance 0.4.1

Expand Down
4 changes: 4 additions & 0 deletions R/download_data_factors.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ download_data_factors_ff <- function(
#' @examples
#' \donttest{
#' download_data_factors_q("factors_q5_daily", "2020-01-01", "2020-12-31")
#' download_data_factors_q("factors_q5_annual")
#' }
download_data_factors_q <- function(
type, start_date = NULL, end_date = NULL, url = "https://global-q.org/uploads/1/2/2/6/122679606/"
Expand Down Expand Up @@ -181,6 +182,9 @@ download_data_factors_q <- function(
} else if (grepl("daily", type, fixed = TRUE)) {
processed_data <- raw_data |>
mutate(DATE = ymd(DATE))
} else if (grepl("annual", type, fixed = TRUE)) {
processed_data <- raw_data |>
mutate(date = year)
}

processed_data <- processed_data |>
Expand Down
1 change: 1 addition & 0 deletions man/download_data_factors_q.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 495d542

Please sign in to comment.