-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metadata #421
Add metadata #421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this, I'm wondering if there is other metadata we should consider. Also, are there other accessor methods that could follow the what pattern here?
gsplot.default <- function(...,config.file=NA, theme=NA, frame.plot=TRUE) { | ||
object <- gsplot(list(global=list('config'=list(frame.plot=frame.plot, | ||
gsplot.default <- function(..., created=Sys.Date(), | ||
gsplot.version=packageDescription("gsplot", fields = "Version"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might use packageVersion("gsplot")
here instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better yet is
packageVersion(getPackageName())
so we don't need to modify it if we change the name of the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried packageVersion("gsplot")
at first, but it returns a list instead of a character string. packageDescription("gsplot", fields = "Version")
returns a single string. To get the output of packageVersion into a single string seemed more complex than using packageDescription.
I will make the package reference generic per @jread-usgs's suggestion.
What is this magic "Approved" that you guys are doing? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh! Cool.
@jiwalker-usgs I think there were other metadata that people suggested, but we decided that #304 would just be the gsplot version and date. |
@jread-usgs the appveyor build failed...is that OK? |
Now each gsplot object will have a top-level list called
metadata
. This PR adds 2 fields:created
which is the date the object is/was created andgsplot.version
the gsplot version used to create the object. Both can be manually input as arguments togsplot()
.This PR also adds to access functions to get those metadata values -
whatDate
andwhatVersion
.See #304