Skip to content

Commit 69cc24a

Browse files
author
Lindsay Carr
committed
added metadata (date object created + gsplot version used) to gsplot object
1 parent e839398 commit 69cc24a

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

R/gsplot-class.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#' Used to change the class of inputs to "gsplot".
44
#'
55
#' @param x list
6+
#' @param created vector of length one giving the date the gsplot object was created. Defaults to
7+
#' using \code{Sys.Date()}. Output class matches that of the input.
8+
#' @param gsplot.version vector of length one giving the version of the gsplot package used to create the
9+
#' object. Defaults to calling \code{packageDescription()}. Output class matches that of the input.
610
#' @param config.file path to the file that will only be used for setting
711
#' par in this one gsplot object. If \code{NA} (default), par is set by the global options set by
812
#' loadConfig().
@@ -19,8 +23,12 @@ gsplot <- function(x = NULL, ...) UseMethod("gsplot")
1923

2024
#' @rdname gsplot
2125
#' @export
22-
gsplot.default <- function(...,config.file=NA, theme=NA, frame.plot=TRUE) {
23-
object <- gsplot(list(global=list('config'=list(frame.plot=frame.plot,
26+
gsplot.default <- function(..., created=Sys.Date(),
27+
gsplot.version=packageDescription("gsplot", fields = "Version"),
28+
config.file=NA, theme=NA, frame.plot=TRUE) {
29+
object <- gsplot(list(metadata=list(created=created,
30+
gsplot.version=gsplot.version),
31+
global=list('config'=list(frame.plot=frame.plot,
2432
config.file=!is.na(config.file),
2533
theme=!is.na(theme)))))
2634

man/gsplot.Rd

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)