-
Notifications
You must be signed in to change notification settings - Fork 265
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
Incongrous function name #3
Comments
Meant to add in my original post that it looks lovely :) If you want to make this change internally as well, a nice way to go about renaming (to not break any existing code) is to make a copy. Rename the theme
Try to wean off of
Eventually upgrade the warning to an error
|
FYI, there's a canonical way to achieve this: ## soft deprecate a function
bbc_style <- function() {
.Deprecated("theme_bbc")
## existing code
list(a = 2, b = 3)
}
## produces a warning
bbc_style()
#> Warning: 'bbc_style' is deprecated.
#> Use 'theme_bbc' instead.
#> See help("Deprecated")
#> $a
#> [1] 2
#>
#> $b
#> [1] 3
## hard deprecate a function
bbc_style <- function() {
.Defunct("theme_bbc")
}
## produces an error
bbc_style()
#> Error: 'bbc_style' is defunct.
#> Use 'theme_bbc' instead.
#> See help("Defunct") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The
bbc_style
function seems very similar to any otherggplot
theme function, like thetheme_grey
,theme_classic
,theme_light
, etc., built in to theggplot2
package, or many others like those in theggthemes
package.Except the name.
I think it'd be great to change the name of the function to
theme_bbc
if you'd like greater visibility consider submitting it toggthemes
. Withtheme_economist
,theme_fivethirtyeight
, andtheme_wsj
,theme_bbc
would feel right at home :)The text was updated successfully, but these errors were encountered: