Comments (3)
You could also reduce the number of imports by using getExportedValue()
. i.e. instead of:
#' @importFrom viridisLite cividis inferno magma plasma viridis
#' @rdname paleteer-c-wrapper
#' @export
paletteer_c_viridis <- function(name, n) {
pal_gen <- get(name)
pal_gen(n = n)
}
You could write:
#' @rdname paleteer-c-wrapper
#' @export
paletteer_c_viridis <- function(name, n) {
pal_gen <- getExportedValue("viridisLite", name)
pal_gen(n = n)
}
from paletteer.
I'd also be tempted to put the wrappers in a list, like
wrapper_c <- list(
virdis = function(name, n) {
pal_gen <- getExportedValue("viridisLite", name)
pal_gen(n = n)
},
...
}
Then you could eliminate your use of get()
in palette_c()
and instead just use [[
.
from paletteer.
I love it! I was searching for the getExportedValue()
functionally forever without luck. I was never really happy with how I had to import to use get()
.
from paletteer.
Related Issues (20)
- Release paletteer 1.4.1
- Add another package
- add PrettyCols HOT 1
- Add severance palettes
- Release paletteer 1.5.0
- Including an organization's colour pallette? HOT 2
- Add waRhol HOT 1
- For some palettes, metadata are missing in the `.rda` files
- Add vangogh HOT 2
- Does paletteer support custom color breakpoints? HOT 1
- Minor meta data inconsistencies HOT 1
- Add ButterflyColors HOT 1
- add MexBrewer HOT 1
- Add Okabe-Ito HOT 1
- Add theme_park HOT 1
- Add ltc_palettes HOT 1
- Typos in paletteer::palettes_c_names HOT 1
- MoMAColors HOT 1
- import MetBrewer, MoMAColors and PNWColors HOT 1
- painbow HOT 1
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 paletteer.