Skip to content

Commit

Permalink
Merge pull request #668 from adokter/document_select
Browse files Browse the repository at this point in the history
document select method
  • Loading branch information
adokter authored Jul 17, 2024
2 parents f6e6e7c + 5ed90d2 commit 069af26
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

** Bugfixes

* support for tidyverse select method for polar volume and polar scan objects (#668,#460)

* Updated the default refractive index value used in conversion of linear reflectivity (eta) to logarithmic reflectivity (dBZ) (#642). The effect is a 7% increase in animal densities in output of functions `integrate_to_ppi()` and `read_cajun()` only.

# bioRad 0.7.3
Expand Down
19 changes: 19 additions & 0 deletions R/select.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#' Tidyverse methods for bioRad objects
#'
#' Tidyverse methods for bioRad objects, currently only select is implemented. When \code{dplyr} or \code{tidyverse} is loaded the \code{select} method can be used to select parameters.
#' @param .data data object of class \code{scan} or \code{pvol}
#' @param ... other arguments
#' @name tidyverse
#' @examples
#' if (require(dplyr, quietly = TRUE)) {
#' # locate example volume file:
#' pvolfile <- system.file("extdata", "volume.h5", package = "bioRad")
#'
#' # load the file:
#' example_pvol <- read_pvolfile(pvolfile)
#' pvol_selected<-select(example_pvol, DBZH, ZDR)
#' # Only selected parameters are retained in the pvol
#' get_scan(pvol_selected, 1.5)
#' # Also a series of parameters in a scan can be selected
#' select(get_scan(example_pvol, 2.5), VRADH:ZDR)
#' }
# generalizations for the dplyr verb `select` to `scan` and `pvol` objects
select.scan <- function(.data, ...) {
if (!requireNamespace("dplyr", quietly = TRUE)) {
Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ reference:
- integrate_to_ppi
- calculate_param
- apply_mistnet
- tidyverse
- Math.scan
- title: "Plotting radar scans"
desc: "Functions to plot a polar volume (pvol), scan (scan) or parameter (param) on a grid or basemap as a plan position indicator (ppi)."
Expand Down
31 changes: 31 additions & 0 deletions man/tidyverse.Rd

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

0 comments on commit 069af26

Please sign in to comment.