diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index 644b1b0e..272c6adf 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ Version: 0.7.1 -Date: 2023-07-10 19:20:10 UTC -SHA: 3e9e916782d7e86b894e8cc04313b7ad4392c2a1 +Date: 2023-07-17 16:11:14 UTC +SHA: bab8c99165d91822e5bacd5c62ddf4c6cc94c3d7 diff --git a/DESCRIPTION b/DESCRIPTION index f08cf212..0460e9d8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: bioRad Title: Biological Analysis and Visualization of Weather Radar Data -Version: 0.7.0.9617 +Version: 0.7.1 Description: Extract, visualize and summarize aerial movements of birds and insects from weather radar data. See Dokter, A. M. et al. (2018) "bioRad: biological analysis and visualization of weather radar data" @@ -37,7 +37,6 @@ Imports: graphics, lubridate, lutz, - rhdf5, suntools, methods, raster, @@ -52,8 +51,6 @@ Imports: viridis, rlang, jsonlite -Remotes: - bioc::rhdf5 Suggests: vol2birdR, aws.s3, diff --git a/R/apply_mistnet.R b/R/apply_mistnet.R index a1898e82..6dede5eb 100644 --- a/R/apply_mistnet.R +++ b/R/apply_mistnet.R @@ -83,19 +83,22 @@ #' (11), pp. 1908-22. \doi{10.1111/2041-210X.13280} #' #' @examples -#' \dontrun{ +#' \donttest{ #' # make sure you have installed the MistNet libraries and model, using: -#' # vol2birdR::install_mistnet() -#' # vol2birdR::install_mistnet_model() -#' +#' if(!vol2birdR::mistnet_exists()){ +#' vol2birdR::install_mistnet() +#' vol2birdR::install_mistnet_model() +#' } +#' # start a temporary file to store polar volume +#' tempfile=tempfile("KBGM_example") #' # Download a NEXRAD file and save as KBGM_example #' download.file( #' "https://noaa-nexrad-level2.s3.amazonaws.com/2019/10/01/KBGM/KBGM20191001_000542_V06", -#' "~/KBGM_example" +#' tempfile #' ) #' #' # Calculate MistNet segmentation -#' mistnet_pvol <- apply_mistnet("~/KBGM_example") +#' mistnet_pvol <- apply_mistnet(tempfile) #' #' # Print summary info for the segmented elevation scan at the 0.5 degree, #' # verify new parameters BIOLOGY, WEATHER, BACKGROUND and CELL have been added @@ -120,7 +123,7 @@ #' plot(ppi, param = "CELL") #' #' # Remove file -#' file.remove("~/KBGM_example") +#' file.remove(tempfile) #' } apply_mistnet <- function(file, pvolfile_out, verbose = FALSE, mount = dirname(file), load = TRUE, diff --git a/R/plot.scan.R b/R/plot.scan.R index 2fd56ee8..ff9096e8 100644 --- a/R/plot.scan.R +++ b/R/plot.scan.R @@ -37,12 +37,14 @@ #' # Plot reflectivity #' plot(example_scan, param = "DBZH") #' +#' \donttest{ #' # Change the range of reflectivities to plot, from -10 to 10 dBZ #' plot(example_scan, param = "DBZH", zlim = c(-10, 10)) #' #' # Change the scale name, change the color palette to Viridis colors #' plot(example_scan, param = "DBZH", zlim = c(-10, 10)) + #' viridis::scale_fill_viridis(name = "dBZ") +#' } plot.scan <- function(x, param, xlim = c(0, 100000), ylim = c(0, 360), zlim = c(-20, 20), na.value = "transparent", ...) { stopifnot(inherits(x, "scan")) diff --git a/R/rcs.R b/R/rcs.R index 8ac14db8..59db7b28 100644 --- a/R/rcs.R +++ b/R/rcs.R @@ -71,6 +71,8 @@ rcs.vpi <- function(x) { #' @inheritParams rcs #' @param value Numeric. The radar cross section value to assign in cm^2. #' +#' @return The input object with updated density `x$data$dens` and updated radar cross section attribute. +#' #' @export #' #' @seealso diff --git a/R/read_vpfiles.R b/R/read_vpfiles.R index 528b7e9b..c7cccd68 100644 --- a/R/read_vpfiles.R +++ b/R/read_vpfiles.R @@ -101,7 +101,7 @@ read_vp <- function(file) { #' read_vpfiles(vpfile) #' #' # to load multiple files at once: -#' # read_vpfiles(c("my/path/profile1.h5", "my/path/profile2.h5", ...)) +#' read_vpfiles(c(vpfile, vpfile)) read_vpfiles <- function(files) { if (length(files) == 1) { return(read_vp(files)) diff --git a/R/sd_vvp_threshold.R b/R/sd_vvp_threshold.R index 48766cb0..71d905a5 100644 --- a/R/sd_vvp_threshold.R +++ b/R/sd_vvp_threshold.R @@ -64,6 +64,8 @@ sd_vvp_threshold.vpts <- function(x) { #' @inheritParams sd_vvp_threshold #' @param value Numeric. The `sd_vvp` threshold value to assign in m/s. #' +#' @return The input object with updated density `x$data$dens` and `sd_vvp_thresh` attribute. +#' #' @export #' #' @seealso diff --git a/R/vp.R b/R/vp.R index aa379c81..03022578 100644 --- a/R/vp.R +++ b/R/vp.R @@ -67,7 +67,7 @@ #' * [bind_into_vpts()] #' #' @return For [summary.vp()]: prints summary of the `vp` object. -#' +#' #' @examples #' # Check if an object is of class vp #' is.vp(example_vp) @@ -141,6 +141,10 @@ dim.vp <- function(x) { #' #' @export #' +#' @examples +#' # concatenate vp objects into a list: +#' c(example_vp, example_vp) +#' #' @seealso [bind_into_vpts()] c.vp <- function(...) { vp_list <- list(...) diff --git a/README.md b/README.md index 13b46721..d1a2cd1a 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,7 @@ Then load the package with: ``` r library(bioRad) -#> Welcome to bioRad version 0.7.0.9617 +#> Welcome to bioRad version 0.7.1 #> using vol2birdR version 1.0.1 (MistNet installed) ``` diff --git a/codemeta.json b/codemeta.json index 37091dce..8b18a7ce 100644 --- a/codemeta.json +++ b/codemeta.json @@ -345,18 +345,6 @@ "sameAs": "https://CRAN.R-project.org/package=lutz" }, "11": { - "@type": "SoftwareApplication", - "identifier": "rhdf5", - "name": "rhdf5", - "provider": { - "@id": "https://www.bioconductor.org", - "@type": "Organization", - "name": "Bioconductor", - "url": "https://www.bioconductor.org" - }, - "sameAs": "https://bioconductor.org/packages/release/bioc/html/rhdf5.html" - }, - "12": { "@type": "SoftwareApplication", "identifier": "suntools", "name": "suntools", @@ -368,12 +356,12 @@ }, "sameAs": "https://CRAN.R-project.org/package=suntools" }, - "13": { + "12": { "@type": "SoftwareApplication", "identifier": "methods", "name": "methods" }, - "14": { + "13": { "@type": "SoftwareApplication", "identifier": "raster", "name": "raster", @@ -385,7 +373,7 @@ }, "sameAs": "https://CRAN.R-project.org/package=raster" }, - "15": { + "14": { "@type": "SoftwareApplication", "identifier": "readr", "name": "readr", @@ -397,6 +385,18 @@ }, "sameAs": "https://CRAN.R-project.org/package=readr" }, + "15": { + "@type": "SoftwareApplication", + "identifier": "rhdf5", + "name": "rhdf5", + "provider": { + "@id": "https://www.bioconductor.org", + "@type": "Organization", + "name": "Bioconductor", + "url": "https://www.bioconductor.org" + }, + "sameAs": "https://bioconductor.org/packages/release/bioc/html/rhdf5.html" + }, "16": { "@type": "SoftwareApplication", "identifier": "dplyr", @@ -494,7 +494,7 @@ }, "SystemRequirements": null }, - "fileSize": "4883.789KB", + "fileSize": "4884.754KB", "citation": [ { "@type": "ScholarlyArticle", diff --git a/cran-comments.md b/cran-comments.md index 3bba721f..e65b14c8 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,12 +2,9 @@ Addresses all CRAN instructions from the recent 0.7.1 submission: -1. Updated the DESCRIPTION file with references in the suggested format. -2. Replaced 'T' and 'F' with 'TRUE' and 'FALSE'. -3. Added \value tags to all .Rd files that were missing it and provided thorough descriptions of function outputs. -4. Removed all commented code lines in examples. Replaced \dontrun{} with \donttest{} for examples that take more than 5 seconds to execute and kept \dontrun{} where an external model is required -5. Adjusted functions to avoid writing in the user's home filespace. All examples, vignettes, and tests now write to tempdir() by default. +1. added value tags to rcs-set.Rd and sd_vvp_threshold-set.Rd +2. removed commented example in read_vpfiles.Rd. +3. We could not find a commented example in c.vp.Rd as mentioned by the reviewer, since this function did not have an example. We have added an example now. +4. changed dontrun{} example in apply_mistnet to donttest{}, and prevent write in user home directory -The deprecation of spatial packages `rgdal` and `maptools`, and the evolution of `sp` led to the archiving of bioRad on 07.07.2023. All issues arising from spatial packages have been fixed. - -This package will be used extensively in a summer training school next week (Jul 16 - Jul 21), we would greatly appreciate it being restored on CRAN before that time. +This package will be used extensively in a summer training school next week (Jul 16 - Jul 21), we would greatly appreciate it being restored on CRAN as soon as possible. diff --git a/man/apply_mistnet.Rd b/man/apply_mistnet.Rd index eb0d9b2e..b40880df 100644 --- a/man/apply_mistnet.Rd +++ b/man/apply_mistnet.Rd @@ -101,19 +101,22 @@ scans at that spatial location > 0.45. MistNet may run more slowly on Windows than on Linux or Mac OS X. } \examples{ -\dontrun{ +\donttest{ # make sure you have installed the MistNet libraries and model, using: -# vol2birdR::install_mistnet() -# vol2birdR::install_mistnet_model() - +if(!vol2birdR::mistnet_exists()){ + vol2birdR::install_mistnet() + vol2birdR::install_mistnet_model() +} +# start a temporary file to store polar volume +tempfile=tempfile("KBGM_example") # Download a NEXRAD file and save as KBGM_example download.file( "https://noaa-nexrad-level2.s3.amazonaws.com/2019/10/01/KBGM/KBGM20191001_000542_V06", - "~/KBGM_example" + tempfile ) # Calculate MistNet segmentation -mistnet_pvol <- apply_mistnet("~/KBGM_example") +mistnet_pvol <- apply_mistnet(tempfile) # Print summary info for the segmented elevation scan at the 0.5 degree, # verify new parameters BIOLOGY, WEATHER, BACKGROUND and CELL have been added @@ -138,7 +141,7 @@ plot(ppi, param = "BIOLOGY") plot(ppi, param = "CELL") # Remove file -file.remove("~/KBGM_example") +file.remove(tempfile) } } \references{ diff --git a/man/c.vp.Rd b/man/c.vp.Rd index 267e7e2e..83e1ffea 100644 --- a/man/c.vp.Rd +++ b/man/c.vp.Rd @@ -15,6 +15,11 @@ A list of \code{vp} objects. \description{ Concatenates vertical profiles (\code{vp}) into a list of vertical profiles (\code{c(vp, vp, vp)}) and warns if they are not from a single radar. +} +\examples{ +# concatenate vp objects into a list: +c(example_vp, example_vp) + } \seealso{ \code{\link[=bind_into_vpts]{bind_into_vpts()}} diff --git a/man/plot.scan.Rd b/man/plot.scan.Rd index a98bec41..4079e3b1 100644 --- a/man/plot.scan.Rd +++ b/man/plot.scan.Rd @@ -61,6 +61,7 @@ model (ODIM), see Table 16 in the # Plot reflectivity plot(example_scan, param = "DBZH") +\donttest{ # Change the range of reflectivities to plot, from -10 to 10 dBZ plot(example_scan, param = "DBZH", zlim = c(-10, 10)) @@ -68,3 +69,4 @@ plot(example_scan, param = "DBZH", zlim = c(-10, 10)) plot(example_scan, param = "DBZH", zlim = c(-10, 10)) + viridis::scale_fill_viridis(name = "dBZ") } +} diff --git a/man/rcs-set.Rd b/man/rcs-set.Rd index 1c499633..384a6aac 100644 --- a/man/rcs-set.Rd +++ b/man/rcs-set.Rd @@ -23,6 +23,9 @@ rcs(x) <- value \item{value}{Numeric. The radar cross section value to assign in cm^2.} } +\value{ +The input object with updated density \code{x$data$dens} and updated radar cross section attribute. +} \description{ Sets the assumed radar cross section of an object in cm^2. This function also updates the migration densities in \code{x$data$dens} to \code{eta}/\code{rcs} when above diff --git a/man/read_vpfiles.Rd b/man/read_vpfiles.Rd index bd112186..ca8fcd24 100644 --- a/man/read_vpfiles.Rd +++ b/man/read_vpfiles.Rd @@ -29,5 +29,5 @@ vpfile read_vpfiles(vpfile) # to load multiple files at once: -# read_vpfiles(c("my/path/profile1.h5", "my/path/profile2.h5", ...)) +read_vpfiles(c(vpfile, vpfile)) } diff --git a/man/sd_vvp_threshold-set.Rd b/man/sd_vvp_threshold-set.Rd index 0781b0fe..0fd18f20 100644 --- a/man/sd_vvp_threshold-set.Rd +++ b/man/sd_vvp_threshold-set.Rd @@ -20,6 +20,9 @@ sd_vvp_threshold(x) <- value \item{value}{Numeric. The \code{sd_vvp} threshold value to assign in m/s.} } +\value{ +The input object with updated density \code{x$data$dens} and \code{sd_vvp_thresh} attribute. +} \description{ Sets the threshold of radial velocity standard deviation (\code{sd_vvp}) of an object in m/s. Altitude layers with \code{sd_vvp} below this threshold are assumed