Comments (3)
str_keep_seq <- function(x,
by = 2,
offset = 0, #possible numbers -1 to (by - 2)
big.mark = ",",
...) {
if (is.numeric(x)) {
replace(scales::number(x, big.mark = ",", ...),
seq_along(scales::number(x, big.mark = big.mark, ...))
%% by != (offset + 1), "")
}
else {
replace(x, seq_along(x) %% by != (offset + 1), "")
}
}
x <- LETTERS[1:12]
str_keep_seq(x, by = 2, offset = 0)
str_keep_seq(x, by = 2, offset = -1)
str_keep_seq(x, by = 3, offset = 0)
str_keep_seq(x, by = 3, offset = -1)
str_keep_seq(x, by = 3, offset = 1)
from ggblanket.
str_keep_seq <- function(x,
by = 2,
offset = 0, #possible numbers -1 to (n - 2)
big.mark = ",",
...) {
if (is.numeric(x)) {
replace(scales::number(x, big.mark = ",", ...),
seq_along(scales::number(x, big.mark = big.mark, ...))
%% by != (offset + 1), "")
}
else {
replace(x, seq_along(x) %% by != (offset + 1), "")
}
}
x <- LETTERS[1:12]
str_keep_seq(x, by = 2, offset = 0)
str_keep_seq(x, by = 2, offset = -1)
str_keep_seq(x, by = 3, offset = 0)
str_keep_seq(x, by = 3, offset = -1)
str_keep_seq(x, by = 3, offset = 1)
from ggblanket.
Used scales::comma instead and removed big.mark argument, given Hadley comment
r-lib/scales#318
from ggblanket.
Related Issues (20)
- facet_labels_switch and facet_labels_position: remove these args
- design_mode name
- create_mode_*: should these be exported?
- reorder `*ness`, `*_mode_*` and `aes_contrast`
- mode: export flexible function to create a mode HOT 1
- mode: support easy font adjustment HOT 3
- col_palette: could this accept a function e.g `scales::pal_hue()`?
- gapminder: nice learning example
- set_blanket: add `geom_fill` argument
- docs: `thematic` and `theme_set`
- canvasXpress review HOT 3
- make *_title = "" equivalent to *_title = NULL HOT 1
- theme(legend.spacing = unit(0, "cm"))
- set_blanket and weave_* redesign HOT 3
- subtitle not NULL and title NULL, paste0 "\n" HOT 1
- export weave functions HOT 1
- Add `flex_mode_*` args and delete flex HOT 1
- pal: delete old utils functions
- weave_ggplot2 HOT 1
- tests: add more tests for `set_*` and `weave_*` 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 ggblanket.