Skip to content

Export datetime_scale() #5174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Collate:
'ggproto.r'
'ggplot-global.R'
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ export(coord_trans)
export(cut_interval)
export(cut_number)
export(cut_width)
export(datetime_scale)
export(derive)
export(discrete_scale)
export(draw_key_abline)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ggplot2 (development version)

* The `datetime_scale()` scale constructor is now exported for use in extension
packages (@teunbrand, #4701).
* `geom_text()` drops observations where `angle = NA` instead of throwing an
error (@teunbrand, #2757).
* Using two ordered factors as facetting variables in
Expand Down
11 changes: 10 additions & 1 deletion R/scale-date.r
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,16 @@ scale_y_time <- function(name = waiver(),
)
}

## rename to datetime_scale
#' Date/time scale constructor
#'
#' @inheritParams scale_x_datetime
#' @inheritParams continuous_scale
#' @param trans For date/time scales, the name of a date/time transformation or
#' the object itself. Built-in transformations include "hms", "date" and "time".
#' @inheritDotParams continuous_scale -aesthetics -trans -palette -breaks -minor_breaks -labels -guide
#'
#' @export
#' @keywords internal
datetime_scale <- function(aesthetics, trans, palette,
breaks = pretty_breaks(), minor_breaks = waiver(),
labels = waiver(), date_breaks = waiver(),
Expand Down
138 changes: 138 additions & 0 deletions man/datetime_scale.Rd

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