Comments (2)
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 theme_bbc
and add the line
bbc_style <- theme_bbc
Try to wean off of bbc_style
. In a couple months, change it to
bbc_style <- function() {
warning("bbc_style is on a deprecation, please use theme_bbc() instead")
theme_bbc()
}
Eventually upgrade the warning to an error
bbc_style <- function() {
stop("bbc_style is deprecated, please use theme_bbc() instead")
}
from bbplot.
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")
from bbplot.
Related Issues (18)
- Windows Fonts
- failed install file incomplete HOT 2
- line_df not defined in README.md HOT 3
- Suggestion for "Color bars Conditionally" example in the cookbook.
- "plot.subtitle" is not a valid theme element name. HOT 1
- Error Failed to install bbplot from GitHub HOT 1
- Suggestion: Add code examples to produce chart examples
- Logo_Image_Path not working as expected
- Cannot install the bbplot HOT 4
- Why is this not plotting? I keep getting the same error. HOT 7
- Error in png::readPNG(logo_image_path): unable to open /placeholder.png
- Black bar at bottom of plot HOT 1
- Add a set of color palettes HOT 1
- The graphic can not show chinese
- Installation issues
- Allow the use of logos from the internet
- [Feature request] - Add arguments to bbc_style() for easy customization HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbplot.