Skip to content

Commit

Permalink
change name from package name from SLD to SD
Browse files Browse the repository at this point in the history
  • Loading branch information
colinpmillar committed May 31, 2017
1 parent e01ad45 commit 0c808c5
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 44 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Package: icesSLD
Package: icesSD
Version: 1.0-0
Date: 2016-11-10
Title: Stock Database Web Services
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(getSLD)
export(getSD)
export(showStock)
importFrom(curl,curl)
importFrom(curl,handle_setheaders)
Expand Down
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
icesSD 1.1-0 (2017-05-31)
--------------------------------------------------------------------------------
o Changed package name to reflect webpage and DB name change.

--------------------------------------------------------------------------------
icesSLD 1.0-0 (2016-11-10)
--------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions R/getSLD.R → R/getSD.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
#'
#' \code{\link{showStock}} shows stock list data for one stock.
#'
#' \code{\link{icesSLD-package}} gives an overview of the package.
#' \code{\link{icesSD-package}} gives an overview of the package.
#'
#' @examples
#' sldata <- getSLD()
#'
#' @export

getSLD <- function() {
getSD <- function() {
# read and parse JSON to data frame
url <- "http://sd.ices.dk/services/odata4/StockListDWs4"
out <- parseSLD(url)
out <- parseSD(url)

out
}
6 changes: 3 additions & 3 deletions R/icesSLD-package.R → R/icesSD-package.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#' @docType package
#'
#' @name icesSLD-package
#' @name icesSD-package
#'
#' @aliases icesSLD
#' @aliases icesSD
#'
#' @title Stock Database Web Services
#'
Expand All @@ -12,7 +12,7 @@
#' @details
#' \emph{Get dataset:}
#' \tabular{ll}{
#' \code{\link{getSLD}} \tab full stock list\cr
#' \code{\link{getSD}} \tab full stock list\cr
#' \code{\link{showStock}} \tab one stock
#' }
#'
Expand Down
8 changes: 4 additions & 4 deletions R/showStock.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
#' @return A single-row data frame, printed to screen with
#' \code{print.simple.list} unless quiet is TRUE.
#'
#' \code{\link{getSLD}} gets all stock list data.
#' \code{\link{getSD}} gets all stock list data.
#'
#' \code{\link{icesSLD-package}} gives an overview of the package.
#' \code{\link{icesSD-package}} gives an overview of the package.
#'
#' @examples
#' showStock("sai-icel")
Expand All @@ -23,8 +23,8 @@

showStock <- function(stock, year = NULL, quiet = FALSE)
{
sldata <- getSLD()
out <- sldata[sldata$StockCode == stock,]
sddata <- getSLD()
out <- sddata[sddata$StockCode == stock,]
if (is.null(year))
year <- max(out$ActiveYear)
out <- out[out$ActiveYear == year,]
Expand Down
6 changes: 3 additions & 3 deletions R/utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
#' @importFrom curl new_handle
#' @importFrom curl handle_setheaders
#' @importFrom curl curl
parseSLD <- function(url) {
parseSD <- function(url) {
# parse JSON string to data frame
fromJSON(url)$value
}


checkSLDWebserviceOK <- function() {
checkSDWebserviceOK <- function() {
# return TRUE if web service is active, FALSE otherwise
out <- parseSLD("http://sd.ices.dk/services/odata4")
out <- parseSD("http://sd.ices.dk/services/odata4")

# check server is not down by inspecting JSON response for internal server error message
if (grepl("404 - File or directory not found", out)) {
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[![Build Status](https://travis-ci.org/ices-tools-prod/icesSLD.svg?branch=master)](https://travis-ci.org/ices-tools-prod/icesSLD)
[![codecov](https://codecov.io/gh/ices-tools-prod/icesSLD/branch/master/graph/badge.svg)](https://codecov.io/gh/ices-tools-prod/icesSLD)
[![GitHub release](https://img.shields.io/github/release/ices-tools-prod/icesSLD.svg?maxAge=2592000)]()
[![CRAN Status](http://www.r-pkg.org/badges/version/icesSLD)](https://cran.r-project.org/package=icesSLD)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/icesSLD)](https://cran.r-project.org/package=icesSLD)
[![Build Status](https://travis-ci.org/ices-tools-prod/icesSD.svg?branch=master)](https://travis-ci.org/ices-tools-prod/icesSD)
[![codecov](https://codecov.io/gh/ices-tools-prod/icesSD/branch/master/graph/badge.svg)](https://codecov.io/gh/ices-tools-prod/icesSD)
[![GitHub release](https://img.shields.io/github/release/ices-tools-prod/icesSD.svg?maxAge=2592000)]()
[![CRAN Status](http://www.r-pkg.org/badges/version/icesSD)](https://cran.r-project.org/package=icesSD)
[![CRAN Downloads](http://cranlogs.r-pkg.org/badges/grand-total/icesSD)](https://cran.r-project.org/package=icesSD)
[![License](https://img.shields.io/badge/license-GPL%20(%3E%3D%202)-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)

[<img align="right" alt="ICES Logo" width="17%" height="17%" src="http://ices.dk/_layouts/15/1033/images/icesimg/iceslogo.png">](http://ices.dk)

icesSLD
icesSD
=======

icesSLD provides R functions that access the
icesSD provides R functions that access the
[web services](http://sd.ices.dk/services/) of the [ICES](http://ices.dk)
[Stock Database](http://sd.ices.dk).

<!-- icesSLD is implemented as an [R](https://www.r-project.org) package and
available on [CRAN](https://cran.r-project.org/package=icesSLD). -->
<!-- icesSD is implemented as an [R](https://www.r-project.org) package and
available on [CRAN](https://cran.r-project.org/package=icesSD). -->

Installation
------------

icesSLD can be installed from GitHub using the `install_github` command from the
icesSD can be installed from GitHub using the `install_github` command from the
`devtools` package:

```R
library(devtools)
install_github("ices-tools-prod/icesSLD")
install_github("ices-tools-prod/icesSD")
```

Usage
Expand All @@ -34,8 +34,8 @@ Usage
For a summary of the package:

```R
library(icesSLD)
?icesSLD
library(icesSD)
?icesSD
```

References
Expand All @@ -50,17 +50,17 @@ http://sd.ices.dk/services/
Development
-----------

icesSLD is developed openly on
[GitHub](https://github.com/ices-tools-prod/icesSLD).
icesSD is developed openly on
[GitHub](https://github.com/ices-tools-prod/icesSD).

Feel free to open an [issue](https://github.com/ices-tools-prod/icesSLD/issues)
Feel free to open an [issue](https://github.com/ices-tools-prod/icesSD/issues)
there if you encounter problems or have suggestions for future versions.

<!--
The current development version can be installed using:
```R
library(devtools)
install_github("ices-tools-prod/icesSLD")
install_github("ices-tools-prod/icesSD")
```
-->
10 changes: 5 additions & 5 deletions man/getSLD.Rd → man/getSD.Rd

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

10 changes: 5 additions & 5 deletions man/icesSLD-package.Rd → man/icesSD-package.Rd

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

4 changes: 2 additions & 2 deletions man/showStock.Rd

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

0 comments on commit 0c808c5

Please sign in to comment.