Skip to content

Commit 721100c

Browse files
author
Lindsay Carr
committed
added access functions to get creation date + gsplot verion
1 parent 69cc24a commit 721100c

File tree

4 files changed

+63
-1
lines changed

4 files changed

+63
-1
lines changed

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export(text)
4646
export(title)
4747
export(view)
4848
export(view_info)
49+
export(whatDate)
50+
export(whatVersion)
4951
export(xlab)
5052
export(xlim)
5153
export(ylab)

R/access-gsplot.R

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,4 +258,28 @@ view_info <- function(object){
258258
viewInfo$y.side.defined.by.user <- viewInfo$y %in% defined.sides
259259

260260
return(viewInfo)
261-
}
261+
}
262+
263+
#' Get gsplot object creation date.
264+
#'
265+
#' Get the date that this gsplot object was originally created.
266+
#'
267+
#' @param object a gsplot object
268+
#' @return The date the gsplot object was created.
269+
#' @export
270+
whatDate <- function(object){
271+
date_created <- object$metadata$created
272+
return(date_created)
273+
}
274+
275+
#' Get gsplot version used.
276+
#'
277+
#' Get the version number that was used to create this gsplot object.
278+
#'
279+
#' @param object a gsplot object
280+
#' @return The gsplot version number.
281+
#' @export
282+
whatVersion <- function(object){
283+
version_created <- object$metadata$gsplot.version
284+
return(version_created)
285+
}

man/whatDate.Rd

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

man/whatVersion.Rd

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

0 commit comments

Comments
 (0)