theme_kc: Theme for ggplot objects (with my preferred defaults)

View source: R/kc_theme.R

theme_kcR Documentation

Theme for ggplot objects (with my preferred defaults)

Description

Similar to hrbrthemes::theme_ipsum()

Usage

theme_kc(text_size = 14, text_font = "Arial Narrow")

Arguments

data

The data frame to tabulate

tabvar

The variables to tabulate

dropna

If TRUE then drops NA values; if FALSE then includes NA values

Value

A ggplot2 object.

Examples

## Not run: 
ggplot(mtcars, aes(y = mpg, x = wt, color = factor(am))) +
  geom_point() +
  geom_smooth() +
  labs(x = "Weight", y = "Miles per Gallon", color = "Automatic",
       caption = "Source: Author's calculations using mtcars dataset") +
  theme_kc() +
  theme(legend.position = "bottom")

ggplot(mtcars, aes(y = mpg, x = wt)) +
  geom_point() +
  geom_smooth() +
  facet_wrap(vars(am), scales = "free_x") +
  labs(x = "Weight", y = "Miles per Gallon",
       caption = "Source: Author's calculations using mtcars dataset") +
  theme_kc() +
  theme(legend.position = "bottom")


## End(Not run)

kennchua/kctools documentation built on Aug. 28, 2024, 8:37 a.m.