is_draft: Is this a draft document?

View source: R/is_draft.R

is_draftR Documentation

Is this a draft document?

Description

Return value of YAML directive "draft:"

Usage

is_draft()

Details

For use in Rmarkdown documents. Return value of YAML directive "draft:", either true or false.

Will return FALSE if "draft:" directive does not exist in rmarkdown file.

Will return FALSE if value of "draft:" directive is not a logical value (true or false).

Value

Logical value: TRUE or FALSE.

Author(s)

Dave Braze davebraze@gmail.com

See Also

metadata

Examples


## May be used to conditionally watermark ggplots
library(ggplot2)
data(iris)
tmp <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, color=Species)) +
  geom_point()

if (is_draft()) {watermark(tmp)} else {tmp}

## If called from within YAML block use FDBpub::is_draft().
FDBpub::is_draft()


davebraze/FDBpub documentation built on April 30, 2022, 11:23 p.m.