Skip to content

Commit

Permalink
Merge pull request #242 from olivroy/ggplot
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 authored Dec 20, 2023
2 parents cec7a17 + 4943ebe commit 3e6814b
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
10 changes: 6 additions & 4 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

## Breaking changes

- tidyquant no longer loads lubridate. (#237, @olivroy)
- 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.
- tidyquant no longer loads many packages on load.

## Fixes

- tidyquant startup messages mimics the tidyverse messages for clarity. (#163, #116)
- Remove the dependency on tidyverse (#236, @olivroy)
- 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 `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 explicitly install those, but you can install them from CRAN.
- Fixed CRAN package alias
- FB to META change in `FANG`
- `geom_bbands()`, `geom_candlestick()`, and `geom_barchart()` no longer emit dropped aesthetics warnings. (@olivroy, #235)


# tidyquant 1.0.7

Expand Down
14 changes: 7 additions & 7 deletions R/ggplot-geom_bbands.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
#' geom_line() + # Plot stock price
#' geom_bbands(aes(high = high, low = low, close = close), ma_fun = SMA, n = 50) +
#' coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
#' ylim = c(75, 125))
#' ylim = c(20, 35))
#'
#'
#' # EMA
Expand All @@ -87,7 +87,7 @@
#' geom_bbands(aes(high = high, low = low, close = close),
#' ma_fun = EMA, wilder = TRUE, ratio = NULL, n = 50) +
#' coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
#' ylim = c(75, 125))
#' ylim = c(20, 35))
#'
#'
#' # VWMA
Expand All @@ -97,7 +97,7 @@
#' geom_bbands(aes(high = high, low = low, close = close, volume = volume),
#' ma_fun = VWMA, n = 50) +
#' coord_x_date(xlim = c(as_date("2016-12-31") - dyears(1), as_date("2016-12-31")),
#' ylim = c(75, 125))
#' ylim = c(20, 35))


#' @rdname geom_bbands
Expand Down Expand Up @@ -166,7 +166,7 @@ geom_bbands_ <- function(mapping = NULL, data = NULL,

StatBBandsRibbon <- ggplot2::ggproto("StatBBandsRibbon", ggplot2::Stat,
required_aes = c("x", "high", "low", "close"),

dropped_aes = c("high", "low", "close", "y"),
compute_group = function(data, scales, params,
n = 10, ma_fun = SMA, sd = 2,
wilder = FALSE, ratio = NULL,
Expand All @@ -192,7 +192,7 @@ StatBBandsRibbon <- ggplot2::ggproto("StatBBandsRibbon", ggplot2::Stat,

StatBBandsMA <- ggplot2::ggproto("StatBBandsMA", ggplot2::Stat,
required_aes = c("x", "high", "low", "close"),

dropped_aes = c("high", "low", "close", "y"),
compute_group = function(data, scales, params,
ma_fun = "SMA", n = 20, sd = 2,
wilder = FALSE, ratio = NULL,
Expand All @@ -217,7 +217,7 @@ StatBBandsMA <- ggplot2::ggproto("StatBBandsMA", ggplot2::Stat,

StatBBandsRibbon_vol <- ggplot2::ggproto("StatBBandsRibbon", ggplot2::Stat,
required_aes = c("x", "high", "low", "close", "volume"),

dropped_aes = c("high", "low", "close", "volume", "y"),
compute_group = function(data, scales, params,
ma_fun = "SMA", n = 10, sd = 2,
wilder = FALSE, ratio = NULL,
Expand All @@ -244,7 +244,7 @@ StatBBandsRibbon_vol <- ggplot2::ggproto("StatBBandsRibbon", ggplot2::Stat,

StatBBandsMA_vol <- ggplot2::ggproto("StatBBandsMA", ggplot2::Stat,
required_aes = c("x", "high", "low", "close", "volume"),

dropped_aes = c("high", "low", "close", "volume", "y"),
compute_group = function(data, scales, params,
n = 20, ma_fun = SMA, sd = 2,
wilder = FALSE, ratio = NULL,
Expand Down
12 changes: 6 additions & 6 deletions R/ggplot-geom_chart.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
#' geom_barchart(aes(open = open, high = high, low = low, close = close)) +
#' geom_ma(color = "darkgreen") +
#' coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
#' ylim = c(75, 125))
#' ylim = c(20, 30))
#'
#' # Candlestick Chart
#' AAPL %>%
#' ggplot(aes(x = date, y = close)) +
#' geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
#' geom_ma(color = "darkgreen") +
#' coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
#' ylim = c(75, 125))
#' ylim = c(20, 30))

# Bar Chart -----

Expand Down Expand Up @@ -105,7 +105,7 @@ geom_barchart <- function(mapping = NULL, data = NULL, stat = "identity",

StatLinerangeBC <- ggplot2::ggproto("StatLinerangeBC", ggplot2::Stat,
required_aes = c("x", "open", "high", "low", "close"),

dropped_aes = c("open", "high", "low", "close", "y"),
compute_group = function(data, scales, params,
fill_up, fill_down,
colour_up, colour_down) {
Expand All @@ -122,7 +122,7 @@ StatLinerangeBC <- ggplot2::ggproto("StatLinerangeBC", ggplot2::Stat,

StatSegmentLeftBC <- ggplot2::ggproto("StatSegmentLeftBC", ggplot2::Stat,
required_aes = c("x", "open", "high", "low", "close"),

dropped_aes = c("open", "high", "low", "close"),
compute_group = function(data, scales, params,
fill_up, fill_down,
colour_up, colour_down) {
Expand All @@ -141,7 +141,7 @@ StatSegmentLeftBC <- ggplot2::ggproto("StatSegmentLeftBC", ggplot2::Stat,

StatSegmentRightBC <- ggplot2::ggproto("StatSegmentRightBC", ggplot2::Stat,
required_aes = c("x", "open", "high", "low", "close"),

dropped_aes = c("open", "high", "low", "close"),
compute_group = function(data, scales, params,
fill_up, fill_down,
colour_up, colour_down) {
Expand Down Expand Up @@ -204,7 +204,7 @@ geom_candlestick <- function(mapping = NULL, data = NULL, stat = "identity",

StatRectCS <- ggplot2::ggproto("StatRectCS", ggplot2::Stat,
required_aes = c("x", "open", "high", "low", "close"),

dropped_aes = c("open", "high", "low", "close", "x", "y"),
compute_group = function(data, scales, params,
fill_up, fill_down,
colour_up, colour_down) {
Expand Down
2 changes: 1 addition & 1 deletion R/ggplot-theme_tq.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' ratio = NULL,
#' n = 50) +
#' coord_x_date(xlim = c("2016-01-01", "2016-12-31"),
#' ylim = c(75, 125)) +
#' ylim = c(20, 35)) +
#' labs(title = "Apple BBands",
#' x = "Date",
#' y = "Price") +
Expand Down
8 changes: 4 additions & 4 deletions man/geom_bbands.Rd

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

4 changes: 2 additions & 2 deletions man/geom_chart.Rd

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

2 changes: 1 addition & 1 deletion man/geom_ma.Rd

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

2 changes: 1 addition & 1 deletion man/theme_tq.Rd

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

0 comments on commit 3e6814b

Please sign in to comment.