diff --git a/DESCRIPTION b/DESCRIPTION index 130364f..20e191c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,4 +1,4 @@ -Package: icesSLD +Package: icesSD Version: 1.0-0 Date: 2016-11-10 Title: Stock Database Web Services diff --git a/NAMESPACE b/NAMESPACE index 8b8a9ec..b8f51de 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/NEWS b/NEWS index 6ae29f8..a952386 100644 --- a/NEWS +++ b/NEWS @@ -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) -------------------------------------------------------------------------------- diff --git a/R/getSLD.R b/R/getSD.R similarity index 76% rename from R/getSLD.R rename to R/getSD.R index a22a2c6..e573a12 100644 --- a/R/getSLD.R +++ b/R/getSD.R @@ -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 } diff --git a/R/icesSLD-package.R b/R/icesSD-package.R similarity index 82% rename from R/icesSLD-package.R rename to R/icesSD-package.R index bcace63..cf060a1 100644 --- a/R/icesSLD-package.R +++ b/R/icesSD-package.R @@ -1,8 +1,8 @@ #' @docType package #' -#' @name icesSLD-package +#' @name icesSD-package #' -#' @aliases icesSLD +#' @aliases icesSD #' #' @title Stock Database Web Services #' @@ -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 #' } #' diff --git a/R/showStock.R b/R/showStock.R index 5c0edcf..76603df 100644 --- a/R/showStock.R +++ b/R/showStock.R @@ -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") @@ -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,] diff --git a/R/utilities.R b/R/utilities.R index 74728b7..e45c0e2 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -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)) { diff --git a/README.md b/README.md index a3fbf82..44d3698 100644 --- a/README.md +++ b/README.md @@ -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) [ICES Logo](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). - + 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 @@ -34,8 +34,8 @@ Usage For a summary of the package: ```R -library(icesSLD) -?icesSLD +library(icesSD) +?icesSD ``` References @@ -50,10 +50,10 @@ 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. diff --git a/man/getSLD.Rd b/man/getSD.Rd similarity index 67% rename from man/getSLD.Rd rename to man/getSD.Rd index 238a364..1bc3e33 100644 --- a/man/getSLD.Rd +++ b/man/getSD.Rd @@ -1,17 +1,17 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/getSLD.R -\name{getSLD} -\alias{getSLD} +% Please edit documentation in R/getSD.R +\name{getSD} +\alias{getSD} \title{Get Stock List Data} \usage{ -getSLD() +getSD() } \value{ A data frame. \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. } \description{ Get stock list data such as stock code, expert group, assessment type, etc. diff --git a/man/icesSLD-package.Rd b/man/icesSD-package.Rd similarity index 73% rename from man/icesSLD-package.Rd rename to man/icesSD-package.Rd index 00b262f..c7b240a 100644 --- a/man/icesSLD-package.Rd +++ b/man/icesSD-package.Rd @@ -1,9 +1,9 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/icesSLD-package.R +% Please edit documentation in R/icesSD-package.R \docType{package} -\name{icesSLD-package} -\alias{icesSLD-package} -\alias{icesSLD} +\name{icesSD-package} +\alias{icesSD-package} +\alias{icesSD} \title{Stock Database Web Services} \description{ R interface to access the web services of the ICES Stock Database. @@ -11,7 +11,7 @@ R interface to access the web services of the ICES Stock Database. \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 } } diff --git a/man/showStock.Rd b/man/showStock.Rd index 628b8be..c51967f 100644 --- a/man/showStock.Rd +++ b/man/showStock.Rd @@ -18,9 +18,9 @@ most recent year available.} 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. } \description{ Show stock list data for a given stock, such as expert group, advice group,