tickr: Adjust axis tick marks and labels

Description Usage Arguments Value Examples

View source: R/tickr.R

Description

Adjust axis tick marks and labels

Usage

1
tickr(data, var, to = 5, start = NULL, end = NULL, min = NULL)

Arguments

data

= input dataframe

var

= variable of interest e.g., year

to

= step increase desired e.g., every 5 years

start

= adjust the start value

end

= adjust the end vlaue

min

= lowest value to label

Value

tickr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data.frame(year = 1970:2019,
catch = rnorm(50, 10, 2)) -> df

xaxis <- tickr(df, year, 10)

df %>%
  ggplot(aes(year, catch)) +
  geom_point() +
  scale_x_continuous(labels = xaxis$labels, breaks = xaxis$breaks)

theme_set(theme_report(base_size = 12, base_family = "Bookman"))

ben-williams/funcr documentation built on Nov. 19, 2020, 8:06 a.m.