Skip to content

Commit

Permalink
Prep for CRAN's requested patch, #290
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Dec 9, 2019
1 parent f75a491 commit 9bb6e0c
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 29 deletions.
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# EML 2.0.1

* Improve error message for get_attributes (#286)
* Avoid `ifelse()` for portability (#283)
* Avoid edge case that can create invalid EML in `set_taxonomicNames()` (#280)
* Add documentation regarding the use of dimensionless units (#276)
* Avoid test errors on systems for which pandoc cannot be installed (#290)

# EML 2.0.0

* EML 2.0.0 is a ground-up rewrite of EML 1.x package. The primary difference
Expand Down
23 changes: 16 additions & 7 deletions R/set_TextType.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
## Developer note: Some functions not fully compatible with pandoc < 2.0
## Developer note: Some functions not fully compatible with pandoc < 2.0

#' set_TextType
#'
#' For any EML element of class TextType, this function can be used to generate the appropriate EML from a markdown-formatted file.
#' @param text a plain text character string which will be used directly as the content of the node if no file is given
#' For any EML element of class TextType, this function can be used to generate
#' the appropriate EML from a markdown-formatted file.
#' @param text a plain text character string which will be used directly as the content
#' of the node if no file is given
#' @param file path to a file providing formatted input text, see details.
#' @return a TextType object that can be coerced into any element inheriting from TextType, see examples
#' @importFrom tools file_ext
Expand All @@ -20,23 +22,23 @@
#' ## using a simple character string
#' a <- set_TextType(text = "This is the abstract")
#' as(a, "abstract")
#'
#'
#' ## Using an external markdown file
#' f <- system.file("examples/hf205-abstract.md", package = "EML")
#' a <- set_TextType(f)
#' as(a, "abstract")
#'
#'
#' ## Can also import from methods written in a .docx MS Word file.
#' f <- system.file("examples/hf205-abstract.docx", package = "EML")
#' a <- set_TextType(f)
#' as(a, "abstract")
#'
#'
#' ## Documents with title headings use `section` instead of `para` notation
#' f <- system.file("examples/hf205-methods.docx", package = "EML")
#' d <- set_TextType(f)
#' as(d, "description")
#' }
#'
#'
set_TextType <- function(file = NULL, text = NULL) {
if (!is.null(text)) {
TextType <- text
Expand Down Expand Up @@ -92,6 +94,13 @@ to_docbook <- function(file = NULL) {
call. = FALSE
)
}
if (!rmarkdown::pandoc_available()) {
stop(paste("Pandoc is required to convert to Docbook format.",
"Please supply input text directly"),
call. = FALSE
)
}

pandoc_convert <-
getExportedValue("rmarkdown", "pandoc_convert")

Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ has_pandoc <- rmarkdown::pandoc_available()



EML is a widely used metadata standard in the ecological and environmental sciences. We strongly recommend that interested users visit the [EML Homepage](https://knb.ecoinformatics.org/#external//emlparser/docs/index.html) for an introduction and thorough documentation of the standard. Additionally, the scientific article *[The New Bioinformatics: Integrating Ecological Data from the Gene to the Biosphere (Jones et al 2006)](http://doi.org/10.1146/annurev.ecolsys.37.091305.110031)* provides an excellent introduction into the role EML plays in building metadata-driven data repositories to address the needs of highly heterogeneous data that cannot be easily reduced to a traditional vertically integrated database. At this time, the `EML` R package provides support for the serializing and parsing of all low-level EML concepts, but still assumes some familiarity with the EML standard, particularly for users seeking to create their own EML files. We hope to add more higher-level functions which will make such familiarity less essential in future development.
EML is a widely used metadata standard in the ecological and environmental sciences. We strongly recommend that interested users visit the [EML Homepage](https://eml.ecoinformatics.org/) for an introduction and thorough documentation of the standard. Additionally, the scientific article *[The New Bioinformatics: Integrating Ecological Data from the Gene to the Biosphere (Jones et al 2006)](http://doi.org/10.1146/annurev.ecolsys.37.091305.110031)* provides an excellent introduction into the role EML plays in building metadata-driven data repositories to address the needs of highly heterogeneous data that cannot be easily reduced to a traditional vertically integrated database. At this time, the `EML` R package provides support for the serializing and parsing of all low-level EML concepts, but still assumes some familiarity with the EML standard, particularly for users seeking to create their own EML files. We hope to add more higher-level functions which will make such familiarity less essential in future development.


## Notes on the EML v2.0 Release

`EML` v2.0 is a complete re-write which aims to provide both a drop-in replacement for the higher-level functions of the existing EML package while also providing additional functionality. This new `EML` version uses only simple and familiar list structures (S3 classes) instead of the more cumbersome use of S4 found in the original `EML`. While the higher-level functions are identical, this makes it easier to for most users and developers to work with `eml` objects and also to write their own functions for creating and manipulating EML objects. Under the hood, `EML` relies on the [emld](https://github.com/cboettig/emld) package, which uses a Linked Data representation for EML. It is this approach which lets us combine the simplicity of lists with the specificity required by the XML schema.

This revision also supports the upcoming release of the EML 2.2 specification.
This revision also supports the **[recently released EML 2.2.0 specification](https://eml.ecoinformatics.org/whats-new-in-eml-2-2-0.html)**.

# Creating EML

Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ status](https://www.r-pkg.org/badges/version/EML)](https://cran.r-project.org/pa

EML is a widely used metadata standard in the ecological and
environmental sciences. We strongly recommend that interested users
visit the [EML
Homepage](https://knb.ecoinformatics.org/#external//emlparser/docs/index.html)
for an introduction and thorough documentation of the standard.
Additionally, the scientific article *[The New Bioinformatics:
Integrating Ecological Data from the Gene to the Biosphere (Jones et
visit the [EML Homepage](https://eml.ecoinformatics.org/) for an
introduction and thorough documentation of the standard. Additionally,
the scientific article *[The New Bioinformatics: Integrating Ecological
Data from the Gene to the Biosphere (Jones et
al 2006)](http://doi.org/10.1146/annurev.ecolsys.37.091305.110031)*
provides an excellent introduction into the role EML plays in building
metadata-driven data repositories to address the needs of highly
Expand All @@ -47,8 +46,8 @@ which uses a Linked Data representation for EML. It is this approach
which lets us combine the simplicity of lists with the specificity
required by the XML schema.

This revision also supports the upcoming release of the EML 2.2
specification.
This revision also supports the **[recently released EML 2.2.0
specification](https://eml.ecoinformatics.org/whats-new-in-eml-2-2-0.html)**.

# Creating EML

Expand Down Expand Up @@ -76,7 +75,7 @@ eml_validate("ex.xml")

## A Richer Example

Here we show a the creation of a relatively complete EML document using
Here we show the creation of a relatively complete EML document using
`EML`. This closely parallels the function calls shown in the original
EML [R-package
vignette](https://docs.ropensci.org/EML/articles/creating-EML.html).
Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"version": "3.5.3",
"version": "3.6.1",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 3.5.3 (2019-03-11)",
"runtimePlatform": "R version 3.6.1 (2019-07-05)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -336,7 +336,7 @@
}
],
"readme": "https://github.com/ropensci/EML/blob/master/README.md",
"fileSize": "490.911KB",
"fileSize": "491.462KB",
"contIntegration": [
"https://travis-ci.org/ropensci/EML",
"https://ci.appveyor.com/project/cboettig/eml",
Expand Down
8 changes: 2 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
This is a thorough re-write of the EML package based on S3 instead of S4
object system.
This release provides the requested changes to avoid errors in testing on systems
for which pandoc is not or cannot be installed.

## Test environments
* local OS X install, R 3.5.3
* ubuntu 14.04 (on travis-ci), R 3.5.3
* win-builder (devel and release)

## R CMD check results

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-additional-tests.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ test_that("set_physical can compute file size automatically", {
})

test_that("set_method with additional input files", {

skip_on_appveyor()

skip_on_cran()

coverage <-
set_coverage(
date = c("2012-06-01", "2013-12-31"),
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test-eml2.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ test_that("we can do a complete eml construction", {
## Appveyor cannot even evaluate rmarkdown::pandoc_version() ?
skip_on_appveyor()
skip_on_os("solaris")
skip_on_cran()


## ------------------------------------------------------------------------
geographicDescription <-
Expand Down

0 comments on commit 9bb6e0c

Please sign in to comment.