Skip to content

Commit 3b654af

Browse files
committed
Rename .f to .p
1 parent 78942d4 commit 3b654af

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

R/misc.utilities.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -538,15 +538,15 @@ opttest <- function(expr, testname=NULL, testvar="ENABLE_statnet_TESTS", yesvals
538538
#' Test if all items in a vector or a list are identical.
539539
#'
540540
#' @param x a vector or a list
541-
#' @param .f a function of two arguments returning a logical.
541+
#' @param .f a predicate function of two arguments returning a logical.
542542
#' Defaults to [identical()].
543-
#' @param .ref integer; element of `x` to which all the remaining ones will
544-
#' be compared. Defaults to 1.
545-
#' @param ... additional arguments passed to `.f()`
543+
#' @param .ref integer; index of element of `x` to which all the remaining
544+
#' ones will be compared. Defaults to 1.
545+
#' @param ... additional arguments passed to `.p()`
546546
#'
547547
#' @return By default `TRUE` if all elements of `x` are identical to each
548548
#' other, `FALSE` otherwise. In the general case, `all_identical()`
549-
#' returns `TRUE` if and only if `fun()` returns `TRUE` for all the pairs
549+
#' returns `TRUE` if and only if `.p()` returns `TRUE` for all the pairs
550550
#' involving the first element and the remaining elements.
551551
#'
552552
#' @seealso [identical()], [all.equal()]
@@ -573,12 +573,12 @@ opttest <- function(expr, testname=NULL, testvar="ENABLE_statnet_TESTS", yesvals
573573
#' all_identical(x[-2], all.equal) # is FALSE
574574
#'
575575
#' @export
576-
all_identical <- function(x, .f = identical, .ref = 1L, ...){
576+
all_identical <- function(x, .p = identical, .ref = 1L, ...){
577577
if(length(x) == 0) return(TRUE)
578-
stopifnot(is.function(.f))
578+
stopifnot(is.function(.p))
579579
stopifnot(length(.ref) == 1)
580580
v0 <- x[[.ref]]
581-
for(v in x[- .ref]) if(!isTRUE(.f(v0, v, ...))) return(FALSE)
581+
for(v in x[- .ref]) if(!isTRUE(.p(v0, v, ...))) return(FALSE)
582582
return(TRUE)
583583
}
584584

man/all_identical.Rd

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)