Skip to content
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

Generate an EML file given a data.frame and appropriate metadata #2

Closed
cboettig opened this issue Jun 26, 2013 · 1 comment
Closed
Assignees

Comments

@cboettig
Copy link
Member

To begin with, consider rendering a data.frame such as this

 dat = data.frame(river=c("SAC", "SAC", "AM"), 
                   spp = c("king", "king", "ccho"), 
                   stg = c("smolt", "parr", "smolt"),
                   ct =  c(293L, 410L, 210L))

with the following accompanying metadata:

 col_metadata = c(river = "http://dbpedia.org/ontology/River",
                  spp = "http://dbpedia.org/ontology/Species", 
                  stg = "Life history stage",
                  ct = "count")
 unit_metadata = 
  list(river = c(SAC = "The Sacramento River", AM = "The American River"),
       spp = c(king = "King Salmon", ccho = "Coho Salmon"),
       stg = c(parr = "third life stage", smolt = "fourth life stage"),
       ct = "number")

into EML.

@cboettig
Copy link
Member Author

Basic writing of a valid EML object from an R data.frame is now implemented:

Given the data and metadata above, we simply do:

eml$set(givenName = "Carl", surName = "Boettiger", email = "cboettig@ropensci.org")
eml_write(dat, col_metadata, unit_metadata, file="my_eml_data.xml")
  • We translate R object types (integer, float, factor, character string, POSIXt time) automatically
  • Generates minimal EML (A dataset node with a contact node and dataTable node)

Much to be done in providing additional metadata fields and support for alternative data types, units, and formats. See issues under write eml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant