watermark: Create a copy of a plot with a watermark

Description Usage Arguments Author(s) Examples

View source: R/watermark.R

Description

To avoid errors caused by mistakenly using graphs not intended publication, a copy of graphs with a watermark added should be used in draft publications. This function is designed to make a copy of an image and add a watermark to it. The source can be any image file accepted by image_read. The function will produce a .png file in the same location with filename identical accept for addition of a prefix/suffix.

Usage

1
2
watermark(path, text = "Preliminary for internal discussion",
  colour = "#80808030", prefix = "W_", suffix = "", scale = 1)

Arguments

path

file path of the plot image to have a watermark added to.

text

text to display as the watermark. Default is 'Preliminary for internal discussion.

colour

colour to be used for watermark, can be partially transparent. Default is '#80808030', a translucent grey.

prefix

A string to add to the start of the filename. Default is "W_".

suffix

A string to add to the end of the filename. The default is empty, this may be used as an alternative to the prefix.

scale

A number to rescale watermark. Default is one, which should take up as much space as possible.

Author(s)

Blesson Chacko and Aaron Hayman.

Examples

1
2
3
4
5
6
7
8
9
{
## Not run: 

files = dir()
files=files[grep('f_.+[.]png$',files)]
for(f in files) watermark(f)

## End(Not run)
}

jgrevel/BAST1-R-Library documentation built on May 21, 2019, 10:11 a.m.