as_title: Make nice plot titles

View source: R/format_helpers.R

as_titleR Documentation

Make nice plot titles

Description

Make nice plot titles

Usage

as_title(x, ...)

## S3 method for class 'formula'
as_title(x, ...)

## Default S3 method:
as_title(
  x,
  capitalize_all = TRUE,
  excluded = c("is", "are", "vs", "v.s.", "from", "of", "be", "for", "over"),
  ...
)

## S3 method for class 'fres'
as_title(x, ...)

## S3 method for class 'tres'
as_title(x, ...)

Arguments

x

title content

...

pass to other methods

capitalize_all

make the first letter cap

excluded

exclude making first letter cap, numeric vector

Examples

## Not run: 
# Display normal title
plot_clean(1,1, main = as_title('this is title'))

# Only capitalize the first character
plot_clean(1,1, main = as_title('this is title', capitalize_all = F))

# What if title is a formula
plot_clean(1,1, main = as_title(p[value](beta[1]) < ~.(0.01) ~ ' is significant'))

# Display t-statistics
plot_clean(1,1)
t_stat = get_t(rnorm(10))
title(main=as_title(t_stat))

## End(Not run)

dipterix/rutabaga documentation built on June 25, 2022, 2:38 p.m.