striptext | R Documentation |
Extracts striptext.
Generic, with method striptext.ggplot
.
striptext(x, ...)
x |
object of dispatch |
... |
passed arguments |
list with class 'striptext'
library(magrittr)
library(dplyr)
library(ggplot2)
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point()
) %>% striptext
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_grid(cyl ~ am + gear)
) %>% striptext
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(. ~ cyl + am + gear)
) %>% striptext
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ cyl + am + gear,
labeller = labeller(
.default = label_both
)
)
) %>% striptext
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ cyl + am + gear,
labeller = labeller(
.default = label_both,
.multi_line = FALSE
)
)
) %>% striptext
## Not run:
\donttest{
(
mtcars %>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ cyl + am + gear,
labeller = purrr::partial(
label_both,
sep = "\n"
)
)
) %>% striptext
}
## End(Not run)
(
mtcars %>%
mutate(cyl = paste('cylinders:', cyl)) %>%
mutate(gear = paste('gears:', gear)) %>%
mutate(am = paste('transmission:', am))%>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ cyl + am + gear,
labeller = labeller(
.default = label_wrap_gen(10),
.multi_line = TRUE
)
)
) %>% striptext
(
mtcars %>%
mutate(cyl = paste(sep = '\n', 'cylinders', cyl)) %>%
mutate(gear = paste(sep = '\n', 'gears', gear)) %>%
mutate(am = paste(sep = '\n', 'transmission', am))%>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ cyl + am + gear,
labeller = labeller(
.default = label_wrap_gen(10)
)
)
) %>% striptext
(
mtcars %>%
mutate(cyl = paste(sep = ':', 'cylinders', cyl)) %>%
mutate(gear = paste(sep = ':', 'gears', gear)) %>%
mutate(am = paste(sep = ':', 'transmission', am))%>%
ggplot(aes(wt, mpg)) +
geom_point() +
facet_wrap(
. ~ paste(sep = '\n', cyl, am, gear),
)
) %>% striptext
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.