Skip to content

Commit

Permalink
update spelling checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Apr 22, 2019
1 parent 58bc01f commit 00ee9bc
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 162 deletions.
19 changes: 12 additions & 7 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Package: EML
Type: Package
Title: Create and Manipulate Data using the Ecological Metadata Language
Title: Read and Write Ecological Metadata Language Files
Description: Work with Ecological Metadata Language ('EML') files.
'EML' is a widely used metadata standard in the ecological and
environmental sciences, described in Jones et al. (2006),
<doi:10.1146/annurev.ecolsys.37.091305.110031>.
Version: 2.0.0
Authors@R: c(
person("Carl", "Boettiger",
Expand All @@ -22,23 +26,24 @@ Authors@R: c(
email = "[email protected]",
comment = c(ORCID = "0000-0003-4703-1974"))
)
Description: Read and write Ecological Metadata Language files
License: MIT + file LICENSE
URL: https://github.com/ropensci/EML
BugReports: https://github.com/ropensci/EML/issues
Encoding: UTF-8
LazyData: true
Depends: R (>= 2.10)
Suggests: knitr,
Suggests:
knitr,
taxize,
tibble,
testthat,
covr,
EML,
units,
EML,
units,
htmlwidgets,
shiny,
shinyjs
shinyjs,
spelling
Imports: xml2,
methods,
digest,
Expand All @@ -51,4 +56,4 @@ Imports: xml2,
dplyr
VignetteBuilder: knitr
RoxygenNote: 6.1.1
Remotes: cboettig/emld
Language: en-US
6 changes: 3 additions & 3 deletions R/get_unit_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ get_split_unit <- function(unit, exponents) {

get_valid_unit <- function(unit) {
stopifnot(length(unlist(
gregexpr("\\(", unit))) == length(unlist(gregexpr("\\)", unit))))
gregexpr("\\(", unit))) == length(unlist(gregexpr("\\)", unit))))
# stop if not all parenthesis are closed
stopifnot(!grepl("\\([^\\)]*\\(", unit))
stopifnot(!grepl("\\([^\\)]*\\(", unit))
# stop if nested parenthesis (unable to deparse)
stopifnot(!grepl("\\([^\\)]*\\/[^\\)]*\\)", unit))
# stop if fractions in parenthesis (unable to deparse)

## Preformat unit
## Use x2/y instead of x^2 per y
unit <- gsub("(\\^)(-{0,1}[[:digit:]]+)", "\\2", unit) # remove ^ in front of digits
unit <- gsub("(^|[[:blank:]]+)[p|P]er[[:blank:]]+", " / ", unit)
unit <- gsub("(^|[[:blank:]]+)[p|P]er[[:blank:]]+", " / ", unit)
# replace "per" and "Per" with "/"

## Deal with parenthesis
Expand Down
16 changes: 10 additions & 6 deletions R/set_coverage.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' @param beginDate Starting date for temporal coverage range.
#' @param endDate End date for temporal coverage range
#' @param date give a single date, or vector of single dates covered (instead of beginDate and endDate)
#' @param sci_names string (space seperated) or list or data frame of scientific names for species covered. See details
#' @param sci_names string (space separated) or list or data frame of scientific names for species covered. See details
#' @param geographicDescription text string describing the geographic location
#' @param westBoundingCoordinate Decimal longitude for west edge bounding box
#' @param eastBoundingCoordinate Decimal longitude for east edge bounding box
Expand Down Expand Up @@ -123,7 +123,7 @@ set_temporalCoverage <-
######## Taxonomic Coverage ####################
#' set_taxonomicCoverage
#'
#' @param sci_names string (space seperated) or list or data frame of scientific names for species covered.
#' @param sci_names string (space separated) or list or data frame of scientific names for species covered.
#' @param expand Set to TRUE to use taxize to expand sci_names into full taxonomic classifications
#' @param db The taxonomic database to query (when expand is set to \code{TRUE}). See \code{\link[taxize]{classification}} for valid options. Defaults to 'itis'.
#' @details Turn a data.frame or a list of scientific names into a taxonomicCoverage block
Expand All @@ -140,7 +140,7 @@ set_temporalCoverage <-
#' @export
#' @importFrom methods is
#' @examples
#'
#'
#' sci_names <- data.frame(
#' Kingdom = "Plantae",
#' Phylum = "Phaeophyta",
Expand All @@ -151,21 +151,23 @@ set_temporalCoverage <-
#' Species = "pyrifera"
#' )
#' taxon_coverage <- set_taxonomicCoverage(sci_names)
#'
#'
#' \donttest{ # Examples that may take > 5s
#'
#' # Query ITIS using taxize to fill in the full taxonomy given just species
#' # # names
#' taxon_coverage <- set_taxonomicCoverage(
#' c("Macrocystis pyrifera", "Homo sapiens"),
#' expand = TRUE
#' )
#'
#'
#' # Query GBIF instead of ITIS
#' taxon_coverage <- set_taxonomicCoverage(
#' c("Macrocystis pyrifera"),
#' expand = TRUE,
#' db = "gbif"
#' )
#'
#'
#' ## use a list of lists for multiple species
#' sci_names <- list(list(
#' Kindom = "Plantae",
Expand All @@ -177,6 +179,8 @@ set_temporalCoverage <-
#' Species = "pyrifera"
#' ))
#' set_taxonomicCoverage(sci_names)
#'
#' }
set_taxonomicCoverage <- function(sci_names, expand = FALSE, db = "itis") {
# Expand using taxize and ITIS if the user passes in just scientific names
if (is.character(sci_names) && expand) {
Expand Down
10 changes: 5 additions & 5 deletions R/set_physical.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param numFooterLines Number of footer lines following data. Lines are determined by the physicalLineDelimiter, or if it is absent, by the recordDelimiter. This value indicated the number of footer lines that should be skipped after parsing the data. If this value is omitted, parsers should assume the data continues to the end of the data stream.
#' @param recordDelimiter This element specifies the record delimiter character when the format is text. The record delimiter is usually a linefeed (\\n) on UNIX, a carriage return (\\r) on MacOS, or both (\\r\\n) on Windows/DOS. Multiline records are usually delimited with two line ending characters, for example on UNIX it would be two linefeed characters (\\n\\n). As record delimiters are often non-printing characters, one can use either the special value "\\n" to represent a linefeed (ASCII 0x0a) and "\\r" to represent a carriage return (ASCII 0x0d). Alternatively, one can use the hex value to represent character values (e.g., 0x0a).
#' @param fieldDelimiter "," character by default (for csv files). This element specifies a character to be used in the object for indicating the ending column for an attribute. The delimiter character itself is not part of the attribute value, but rather is present in the column following the last character of the value. Typical delimiter characters include commas, tabs, spaces, and semicolons. The only time the fieldDelimiter character is not interpreted as a delimiter is if it is contained in a quoted string (see quoteCharacter) or is immediately preceded by a literalCharacter. Non-printable quote characters can be provided as their hex values, and for tab characters by its ASCII string "\\t". Processors should assume that the field starts in the column following the previous field if the previous field was fixed, or in the column following the delimiter from the previous field if the previous field was delimited.
#' @param collapseDelimiters The collapseDelimiters element specifies whether sequential delimiters should be treated as a single delimiter or multiple delimiters. An example is when a space delimiter is used; often there may be several repeated spaces that should be treated as a single delimiter, but not always. The valid values are yes or no. If it is set to yes, then consecutive delimiters will be collapsed to one. If set to no or absent, then consecutive delimiters will be treated as separate delimiters. Default behaviour is no; hence, consecutive delimiters will be treated as separate delimiters, by default.
#' @param collapseDelimiters The collapseDelimiters element specifies whether sequential delimiters should be treated as a single delimiter or multiple delimiters. An example is when a space delimiter is used; often there may be several repeated spaces that should be treated as a single delimiter, but not always. The valid values are yes or no. If it is set to yes, then consecutive delimiters will be collapsed to one. If set to no or absent, then consecutive delimiters will be treated as separate delimiters. Default behavior is no; hence, consecutive delimiters will be treated as separate delimiters, by default.
#' @param literalCharacter This element specifies a character to be used for escaping special character values so that they are treated as literal values. This allows "escaping" for special characters like quotes, commas, and spaces when they are intended to be used in an attribute value rather than being intended as a delimiter. The literalCharacter is typically a \\.
#' @param quoteCharacter This element specifies a character to be used in the object for quoting values so that field delimiters can be used within the value. This basically allows delimiter "escaping". The quoteChacter is typically a " or '. When a processor encounters a quote character, it should not interpret any following characters as a delimiter until a matching quote character has been encountered (i.e., quotes come in pairs). It is an error to not provide a closing quote before the record ends. Non-printable quote characters can be provided as their hex values.
#' @param attributeOrientation Specifies whether the attributes described in the physical stream are found in columns or rows. The valid values are column or row. If set to 'column', then the attributes are in columns. If set to 'row', then the attributes are in rows. Row orientation is rare.
Expand Down Expand Up @@ -130,16 +130,16 @@ detect_delim <- function(path, nchar = 1e3) {
error = function(e) {
NA
})

search <- regexpr("[\\r\\n]+", chars, perl = TRUE)

if (!is.na(search) && search >= 0) {
return(substr(chars, search, search + attr(search, "match.length") - 1))
}
}
# readChar() will error on non-character data so


"\r\n"
}

Expand Down
2 changes: 1 addition & 1 deletion R/set_responsibleParty.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @param electronicMailAddress email address (alternatively, can use 'email' argument)
#' @param onlineUrl a URL to the homepage of the individual or organization
#' @param userId the user's ID, usually within a particular system (KNB, DataONE)
#' @param id Identifier for this plock, ideally an ORCID id (optional)
#' @param id Identifier for this block, ideally an ORCID id (optional)
#' @param email alias for electronicMailAddress
#'
#' @return A emld object for any responsibleParty (e.g. creator, contact, etc)
Expand Down
6 changes: 3 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ 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 hetergenous 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://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.


## 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 specificy required by the XML schema.
`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.

Expand All @@ -53,7 +53,7 @@ library(EML)
```{r}
me <- list(individualName = list(givenName = "Carl", surName = "Boettiger"))
my_eml <- list(dataset = list(
title = "A Mimimal Valid EML Dataset",
title = "A Minimal Valid EML Dataset",
creator = me,
contact = me)
)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ 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
hetergenous data that cannot be easily reduced to a traditional
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,
Expand All @@ -44,7 +44,7 @@ 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 specificy
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
Expand All @@ -61,7 +61,7 @@ library(EML)
``` r
me <- list(individualName = list(givenName = "Carl", surName = "Boettiger"))
my_eml <- list(dataset = list(
title = "A Mimimal Valid EML Dataset",
title = "A Minimal Valid EML Dataset",
creator = me,
contact = me)
)
Expand Down
23 changes: 18 additions & 5 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
],
"@type": "SoftwareSourceCode",
"identifier": "EML",
"description": "Read and write Ecological Metadata Language files",
"name": "EML: Create and Manipulate Data using the Ecological Metadata Language",
"description": "Work with Ecological Metadata Language ('EML') files. \n 'EML' is a widely used metadata standard in the ecological and\n environmental sciences, described in Jones et al. (2006),\n <doi:10.1146/annurev.ecolsys.37.091305.110031>.",
"name": "EML: Read and Write Ecological Metadata Language Files",
"codeRepository": "https://github.com/ropensci/EML",
"issueTracker": "https://github.com/ropensci/EML/issues",
"license": "https://spdx.org/licenses/MIT",
Expand Down Expand Up @@ -206,6 +206,18 @@
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=shinyjs"
},
{
"@type": "SoftwareApplication",
"identifier": "spelling",
"name": "spelling",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=spelling"
}
],
"softwareRequirements": [
Expand Down Expand Up @@ -255,7 +267,7 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://github.com/cboettig/emld"
"sameAs": "https://CRAN.R-project.org/package=emld"
},
{
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -324,7 +336,7 @@
}
],
"readme": "https://github.com/ropensci/EML/blob/master/README.md",
"fileSize": "491.102KB",
"fileSize": "490.911KB",
"contIntegration": [
"https://travis-ci.org/ropensci/EML",
"https://ci.appveyor.com/project/cboettig/eml",
Expand All @@ -340,5 +352,6 @@
"r-package"
],
"relatedLink": "https://CRAN.R-project.org/package=EML",
"funder": {}
"funder": {},
"releaseNotes": "https://github.com/ropensci/EML/blob/master/NEWS.md"
}
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This is a thorough re-write of the EML package based on S3 instead of S4
object system.
object system.

## Test environments
* local OS X install, R 3.5.3
Expand All @@ -8,5 +8,5 @@ object system.

## R CMD check results

0 errors | 0 warnings | 1 note
0 errors | 0 warnings | 0 notes

96 changes: 96 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
additionalMetadata
al
annurev
attributeDefinition
attributeLabel
attributeList
attributeName
attributeNames
autocomplete
beginDate
BinHex
Bioinformatics
codecov
codemeta
collapseDelimiters
constantToSI
csv
DataONE
dataTable
dateTime
dateTimeDomain
dbk
deinition
docbook
DocBook
docx
doi
DOI
ecolsys
electronicMailAddress
eml
EML's
EML’s
emld
endDate
enumeratedDomain
et
fieldDelimiter
formatString
handsontable
htmlwidget
http
itis
json
JSON
keywordSet
KNB
LD
lifecycle
literalCharacter
MacOS
md
measurementScale
Metacat
missingValueCode
missingValueCodeExplanation
missingValues
multiplierToSI
NCBII
numberType
numericDomain
ORCID
packageId
pandoc
Pandoc
parentSI
parsers
physicalLineDelimiter
picohenry
PNAS
pre
preformatted
quoteChacter
quoteCharacter
recordDelimiter
responsibleParty
rmarkdown
RStudio
Sirota
sizeUnit
standardUnit
standardUnits
stmml
storageType
taxize
taxonomicClassification
taxonomicCoverage
textDomain
TextType
TSV
unitDictionary
unitList
unitType
unitTypes
validator
XSD
2 changes: 1 addition & 1 deletion man/set_coverage.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 00ee9bc

Please sign in to comment.