Code Monkey home page Code Monkey logo

Comments (5)

cboettig avatar cboettig commented on June 13, 2024

Now approaching this using eml_config, which will allow the user to create S4 objects that can be passed in for frequently used values. These objects can then be loaded from the custom environment hash using:

get("defaultElementName", envir=remlCache)
  • Need to add a method to write out and load in cache between R sessions. Where is a good place to write to for this? system.file?

Still expanding this function. Commonly reused elements we will want to create and provide in this function:

  • intellectualRights element
  • default creator element
  • default contact element
  • multiple saved taxonomic coverage elements (for researcher working on common set of species)
  • default geographic coverage (multiple) (researcher working with common set of field sites)
  • default software element (commonly used software).
  • ...

will continue to amend list as we think of more. feel free to add suggestions.

from eml.

cboettig avatar cboettig commented on June 13, 2024

Anyone ( @mbjones @duncantl @ALL) have advice on a good strategy to cache package settings between R sessions?

We want a user to be able to enter their contact information once and have R remember for future use. We could write this just to the working directory, which has advantages (e.g. could configure different working directories differently), or we could write to some global scratch. My intuition would be to create a hidden/dotfile in the user's home directory; not sure if that would work for windows users, etc?

from eml.

karthik avatar karthik commented on June 13, 2024

Isn’t this exactly what we’d use the .rprofile for? For e.g.  I keep this in mine for devtools package creation:

options(devtools.desc.author = "'Karthik Ram <[email protected]> [aut, cre]'")
options(devtools.desc.license = "CC0”)

Can’t we do something similar?

from eml.

cboettig avatar cboettig commented on June 13, 2024

@karthik Sorry, I should have been clearer -- was thinking about an interactive cache of R objects. Typically we've done that by asking a user to edit .rprofile by hand. Sure, we could writeLines() to .rprofile, but that is poor style, since this could potentially be a large chunk of information (okay, not that big) that isn't needed by every R session. I'd rather load a cache only when reml is loaded.

Thinking this out a bit more, I'm leaning towards doing away with saved configurations as I think it is more likely to create errors and not be flexible enough. For instance, consider the use-case of coverage metadata. While it would be annoying to have to specify the complete geographic coverage for a site you work on all the time, you don't exactly want that coverage metadata be loaded automatically either. You'd rather write the coverage to a file once, and then just copy it over when you need it later, e.g.

eml <- read.eml("my_earlier_eml.xml")
sagehen <- geographic_coverage(eml) 
karthik <- creator(eml)

The user that wanted to save the eml element for later reuse in the standard way (e.g .save(sagehen, "sagehen.rda")), or just extract it from an eml as above. Then it can be written into future EML files explicitly but without going through the tedium of constructing the geographic coverage node, e.g.

write.eml(dat, ..., creator = karthik, geographic_coverage = sagehen)

In general this assigning variable names to reused elements is probably more natural and flexible than trying to remember previous values and re-using them automatically. Sound good?

from eml.

cboettig avatar cboettig commented on June 13, 2024

Working along these lines, I think we'll drop eml_config and illustrate element reuse as above instead. This would better fit the use-case of groups like Harvard Forest, who currently generate EML using a mix of a generic XML editor (Oxygen) for metadata above the entity level and Morpho for attribute details.

All arguments to eml_write take either text-based arguments or existing S4 objects as shown above. See examples in #48.

from eml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.