Git Product home page Git Product logo

Comments (7)

peterdesmet avatar peterdesmet commented on July 18, 2024

The suggested datacite_to_eml() function is now documented at https://inbo.github.io/movepub/reference/datacite_to_eml.html. I think the EML package would be a better home for it.

from eml.

mbjones avatar mbjones commented on July 18, 2024

As another convenience method to template an EML record from existing metadata, this seems useful to me and I would support its inclusion. @cboettig woiuld you have any objections? If not, maybe @peterdesmet could submit a PR?

from eml.

cboettig avatar cboettig commented on July 18, 2024

👍 yeah seems like this would be helpful! PRs welcome!

from eml.

peterdesmet avatar peterdesmet commented on July 18, 2024

Cool, I'll see when I have some time for that. The function relies quite a lot on the purrr package. Is it fine if this is added as a dependency?

from eml.

mbjones avatar mbjones commented on July 18, 2024

For the packages I maintain, I try to keep dependencies to a minimum, especially for large, packages or packages that entrain a complex ecosystem, as they usually cause maintenance headaches down the road. We spend a fair number of cycles just treading water on package dependencies trying to keep packages on CRAN. Backwards incompatible changes or a package being supplanted by a "newer" version (as is common for RStudio packages) has caused a lot of churn for us. That said, if you really need it, then that is what they are there for. But keep in mind that each dependency is a potential future upgrade problem.

from eml.

peterdesmet avatar peterdesmet commented on July 18, 2024

I share your sentiment. I'll see if I can replace my three uses of purrr::map_chr() and two uses of purrr::map() with a base R alternative, if it remains readable (code at https://github.com/inbo/movepub/blob/main/R/datacite_to_eml.R#L26-L49).

from eml.

cboettig avatar cboettig commented on July 18, 2024

map is essentially lapply, and map_chr is essentially vapply with a template type. e.g.

  keywords <- purrr::map_chr(metadata$subjects, "subject")
## is the same as
  keywords <- vapply(metadata$subjects, `[[`, character(1L), "subject")

(yes, [[ is a the familiar sub-setting function, recall in R everything is a function). (Not tested)

That said, purrr is a light dependency compared to some things EML already pulls in....

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.