From b63b838231a7a0d0d45290082194b1a2d5d58d16 Mon Sep 17 00:00:00 2001 From: Arni Magnusson Date: Fri, 17 Feb 2017 14:11:19 +0100 Subject: [PATCH] Remove file at end of example --- DESCRIPTION | 2 +- R/dos2unix.R | 2 ++ R/readDLS.R | 6 ++++-- R/writeDLS.R | 7 ++++--- man/dir.remove.Rd | 1 - man/dos2unix.Rd | 3 ++- man/icesTAF-package.Rd | 9 ++++----- man/readDLS.Rd | 7 ++++--- man/writeDLS.Rd | 21 ++++++++++----------- 9 files changed, 31 insertions(+), 27 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a6b1baa..4dadc63 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,4 +8,4 @@ Suggests: icesAdvice Description: Helper functions for the Transparent Assessment Framework (TAF) used by the International Council for the Exploration of the Sea (ICES). License: GPL (>= 2) -RoxygenNote: 5.0.1 +RoxygenNote: 6.0.1 diff --git a/R/dos2unix.R b/R/dos2unix.R index 5f3af2a..d9ccdf0 100644 --- a/R/dos2unix.R +++ b/R/dos2unix.R @@ -25,6 +25,8 @@ #' #' unix2dos(file) #' file.size(file) +#' +#' file.remove(file) #' } #' #' @export diff --git a/R/readDLS.R b/R/readDLS.R index 2cafe85..b8782e1 100644 --- a/R/readDLS.R +++ b/R/readDLS.R @@ -18,11 +18,13 @@ #' #' @examples #' \dontrun{ -#' library(icesAdvice) #' survey <- data.frame(year=2001:2010, randu[1:10,]) -#' dls <- DLS3.2(1000, survey$y) +#' dls <- icesAdvice::DLS3.2(1000, survey$y) +#' #' writeDLS(dls, "dls.txt") #' readDLS("dls.txt") +#' +#' file.remove("dls.txt") #' } #' #' @export diff --git a/R/writeDLS.R b/R/writeDLS.R index bc4bcb3..efc14ac 100644 --- a/R/writeDLS.R +++ b/R/writeDLS.R @@ -16,13 +16,14 @@ #' #' \code{\link{icesTAF-package}} gives an overview of the package. #' -#' @examples #' \dontrun{ -#' library(icesAdvice) #' survey <- data.frame(year=2001:2010, randu[1:10,]) -#' dls <- DLS3.2(1000, survey$y) +#' dls <- icesAdvice::DLS3.2(1000, survey$y) +#' #' writeDLS(dls, "dls.txt") #' readDLS("dls.txt") +#' +#' file.remove("dls.txt") #' } #' #' @export diff --git a/man/dir.remove.Rd b/man/dir.remove.Rd index 6877b28..5fb34d1 100644 --- a/man/dir.remove.Rd +++ b/man/dir.remove.Rd @@ -29,4 +29,3 @@ dir.remove("emptydir") \code{\link{icesTAF-package}} gives an overview of the package. } - diff --git a/man/dos2unix.Rd b/man/dos2unix.Rd index c0a5d2a..db4d6c1 100644 --- a/man/dos2unix.Rd +++ b/man/dos2unix.Rd @@ -29,6 +29,8 @@ file.size(file) unix2dos(file) file.size(file) + +file.remove(file) } } @@ -39,4 +41,3 @@ file.size(file) \code{\link{icesTAF-package}} gives an overview of the package. } - diff --git a/man/icesTAF-package.Rd b/man/icesTAF-package.Rd index d246eb7..518f1c5 100644 --- a/man/icesTAF-package.Rd +++ b/man/icesTAF-package.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/icesTAF-package.R \docType{package} \name{icesTAF-package} -\alias{icesTAF} \alias{icesTAF-package} +\alias{icesTAF} \title{Helper Functions for the ICES Transparent Assessment Framework} \description{ Helper functions for the Transparent Assessment Framework (TAF) used by the @@ -22,10 +22,9 @@ International Council for the Exploration of the Sea (ICES). \code{\link{unix2dos}} \tab convert line endings } } -\author{ -Arni Magnusson and Colin Millar. -} \references{ ICES Transparent Assessment Framework: \url{http://taf.ices.dk}. } - +\author{ +Arni Magnusson and Colin Millar. +} diff --git a/man/readDLS.Rd b/man/readDLS.Rd index ca7b383..46617bd 100644 --- a/man/readDLS.Rd +++ b/man/readDLS.Rd @@ -18,11 +18,13 @@ Read results from the \code{DLS3.2} advisory method from a file into a list. } \examples{ \dontrun{ -library(icesAdvice) survey <- data.frame(year=2001:2010, randu[1:10,]) -dls <- DLS3.2(1000, survey$y) +dls <- icesAdvice::DLS3.2(1000, survey$y) + writeDLS(dls, "dls.txt") readDLS("dls.txt") + +file.remove("dls.txt") } } @@ -34,4 +36,3 @@ to calculate catch advice for data-limited stocks (DLS). \code{\link{icesTAF-package}} gives an overview of the package. } - diff --git a/man/writeDLS.Rd b/man/writeDLS.Rd index 5dcaaff..920afd2 100644 --- a/man/writeDLS.Rd +++ b/man/writeDLS.Rd @@ -16,16 +16,6 @@ Write results from the \code{DLS3.2} advisory method to a file. } \note{ The resulting text file has Dos line endings (CRLF). -} -\examples{ -\dontrun{ -library(icesAdvice) -survey <- data.frame(year=2001:2010, randu[1:10,]) -dls <- DLS3.2(1000, survey$y) -writeDLS(dls, "dls.txt") -readDLS("dls.txt") -} - } \seealso{ \code{\link{readDLS}} reads \code{DLS3.2} results from a file back into R. @@ -34,5 +24,14 @@ readDLS("dls.txt") to calculate catch advice for data-limited stocks (DLS). \code{\link{icesTAF-package}} gives an overview of the package. -} +\dontrun{ +survey <- data.frame(year=2001:2010, randu[1:10,]) +dls <- icesAdvice::DLS3.2(1000, survey$y) + +writeDLS(dls, "dls.txt") +readDLS("dls.txt") + +file.remove("dls.txt") +} +}