From 4f01e4d5a9984f437a52bf28f38f0232f1088de6 Mon Sep 17 00:00:00 2001 From: brry Date: Thu, 13 Apr 2023 22:35:47 +0200 Subject: [PATCH] readDWD.rklim: examples fixed --- DESCRIPTION | 2 +- R/readDWD.R | 11 ++++++++--- man/readDWD.rklim.Rd | 11 ++++++++--- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index cda0344..e141e7d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: rdwd Title: Select and Download Climate Data from 'DWD' (German Weather Service) -Version: 1.6.14 +Version: 1.6.15 Date: 2023-04-13 Depends: R(>= 2.10) Imports: berryFunctions (>= 1.21.11), pbapply diff --git a/R/readDWD.R b/R/readDWD.R index b675d2c..c8e3f4b 100644 --- a/R/readDWD.R +++ b/R/readDWD.R @@ -1107,16 +1107,21 @@ return(invisible(dat)) #' @seealso [readDWD.binary()], radar locations from \url{https://www.dwd.de/DE/leistungen/radarklimatologie/radklim_kompositformat_1_0.pdf?__blob=publicationFile&v=1} #' @examples #' \dontrun{ # Excluded from CRAN checks, but run in localtests -#' yw_link <- "/5_minutes/radolan/reproc/2017_002/bin/2020/YW2017.002_202006.tar" +#' yw_link <- "/5_minutes/radolan/reproc/2017_002/bin/2022/YW2017.002_202203.tar" +#' # 202006 has untar error on Mac, 2023-04, maybe due to incomplete download #' yw_file <- dataDWD(url=yw_link, base=gridbase, joinbf=TRUE, dir=locdir(), read=FALSE) -#' x <- readDWD(yw_file, selection=3641:3644) +#' # 207 MB +#' x <- readDWD(yw_file, selection=3641:3644) #' # 00:30 for tar files, 01:40 for unpacking. #' # If you need a preselection argument, let me know. #' raster::plot(x$dat) #' #' f <- system.file("tests//raa01-yw2017.002_10000-2006131525-dwd---bin", package="dwdradar") -#' if(f=="") stop("dwdradar test file not found") #' # https://stackoverflow.com/a/72207233/1587132 on how to install with tests folder +#' if(!file.exists(f)) f <- paste0("/Users/berry/Dropbox/Rpack/dwdradar/tests/", +#' "raa01-yw2017.002_10000-2006131525-dwd---bin") +#' # Clone from https://github.com/brry/dwdradar +#' if(!file.exists(f)) stop("dwdradar test file not found") #' #' x <- dwdradar::readRadarFile(f) #' x$dat <- raster::raster(x$dat) diff --git a/man/readDWD.rklim.Rd b/man/readDWD.rklim.Rd index 240960c..d5f376d 100644 --- a/man/readDWD.rklim.Rd +++ b/man/readDWD.rklim.Rd @@ -55,16 +55,21 @@ Note: needs dwdradar >= 0.2.6 (2021-08-08) } \examples{ \dontrun{ # Excluded from CRAN checks, but run in localtests -yw_link <- "/5_minutes/radolan/reproc/2017_002/bin/2020/YW2017.002_202006.tar" +yw_link <- "/5_minutes/radolan/reproc/2017_002/bin/2022/YW2017.002_202203.tar" +# 202006 has untar error on Mac, 2023-04, maybe due to incomplete download yw_file <- dataDWD(url=yw_link, base=gridbase, joinbf=TRUE, dir=locdir(), read=FALSE) -x <- readDWD(yw_file, selection=3641:3644) +# 207 MB +x <- readDWD(yw_file, selection=3641:3644) # 00:30 for tar files, 01:40 for unpacking. # If you need a preselection argument, let me know. raster::plot(x$dat) f <- system.file("tests//raa01-yw2017.002_10000-2006131525-dwd---bin", package="dwdradar") -if(f=="") stop("dwdradar test file not found") # https://stackoverflow.com/a/72207233/1587132 on how to install with tests folder +if(!file.exists(f)) f <- paste0("/Users/berry/Dropbox/Rpack/dwdradar/tests/", + "raa01-yw2017.002_10000-2006131525-dwd---bin") +# Clone from https://github.com/brry/dwdradar +if(!file.exists(f)) stop("dwdradar test file not found") x <- dwdradar::readRadarFile(f) x$dat <- raster::raster(x$dat)