dir.gg: Concatenates a path, filename, and file extension into an...

View source: R/dirfns.R

dir.ggR Documentation

Concatenates a path, filename, and file extension into an output path, then writes a plot to the output path. Any folders in the path that do not exist are created.

Description

Concatenates a path, filename, and file extension into an output path, then writes a plot to the output path. Any folders in the path that do not exist are created.

Usage

dir.gg(x, filename, path = ".", ext = "pdf", ..., append.date = T)

Arguments

x

A plot object.

filename

The output file name.

path

The path to the output file.

ext

The file extension.

...

Additional arguments to ggplot2::ggsave.

append.date

Whether to write the output to a directory with today's date.

See Also

dir.img, ggplot2::ggsave

Examples

library(ggplot2)
x <- ggplot2(iris)
dir.gg(x,"example",path="path/to")
plot(1:5,1:5)
dev.off()

kewiechecki/dirfns documentation built on June 8, 2025, 5:18 a.m.