Description Usage Arguments Examples
Adds a nice background, changes colours (and fill colours) to utilise
r colours, changes text to a r font standin, changes text size,
and adds an optional r logo. The logo can be rendered at half
or full opacity and can be renderd in the centre or the corner at different sizes.
If you want to render the logo behind the graphical objects just put your
call to theme_rquant
earlier than your call to those objects.
1 2 3 | theme_rquant(simple_theme = TRUE, r_font = TRUE, r_colours = TRUE,
font_size = 12L, logo = "none", opacity = 0.1, position = 0L,
inv = FALSE)
|
simple_theme |
logical. Use a simpler theme? default is TRUE. |
r_font |
logical. Use the r font? (Bold Calibri is used as a stand-in) |
r_colours |
logical. Use the r colours for colour and fill? |
font_size |
text size (in pts) |
logo |
character. one of |
opacity |
numeric. 0 to 1, default 0.5 |
position |
an integer usually less than 8. different logos have different options. The first 5 options are: |
inv |
1,2,3 color themes |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | ## Not run:
set.seed(1)
dt <- data.frame(x = 1:10, y = 1:10, z = runif(10)*10, c = sample(LETTERS[1:5],10, replace = TRUE))
dt
p <- ggplot(dt) +
geom_bar(aes(x= x, y = y, fill = rev(c)), stat = "identity") +
geom_point(aes(x= x, y = z, col = c), size = 5) +
ggtitle("r Plot")
p
# Add r colours
p + theme_rquant(simple_theme = FALSE, r_font = FALSE)
# Add a visually pleasing theme (theme_minimal())
p + theme_rquant(r_font = FALSE)
# Add r font
p + theme_rquant()
# Add the r logo
p + theme_rquant(logo = "r")
# Add a transparent logo
p + theme_rquant(logo = "r", opacity = 0.3)
# change the logos position and size
p + theme_rquant(logo = "r", opacity = 1, position = 1)
p + theme_rquant(logo = "r", opacity = 1, position = 3)
# Add a logo which sits 'behind' the graphical objects
ggplot(dt) +
theme_rquant(logo = "r", opacity = 0.5, position = 0) +
geom_bar(aes(x= x, y = y, fill = rev(c)), stat = "identity") +
geom_point(aes(x= x, y = z, col = c), size = 5) +
ggtitle("r Plot")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.