Skip to content

Commit 38eb4c0

Browse files
committed
Added a unique() method for term_list objects.
1 parent 340471b commit 38eb4c0

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: statnet.common
2-
Version: 4.14.0-512
3-
Date: 2026-02-11
2+
Version: 4.14.0-513
3+
Date: 2026-03-20
44
Title: Common R Scripts and Utilities Used by the Statnet Project Software
55
Authors@R: c(
66
person(c("Pavel", "N."), "Krivitsky", role=c("aut","cre"), email="pavel@statnet.org", comment=c(ORCID="0000-0002-9101-3362", affiliation="University of New South Wales")),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ S3method(split,array)
5151
S3method(split,matrix)
5252
S3method(trim_env,default)
5353
S3method(trim_env,environment)
54+
S3method(unique,term_list)
5455
S3method(update,Welford)
5556
export("EVL<-")
5657
export("NVL<-")

R/formula.utilities.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,12 @@ c.term_list <- function(x, ...){
343343
term_list(NextMethod(), sign = sign(x)[i], env = envir(x)[i])
344344
}
345345

346+
#' @rdname term_list
347+
#' @export
348+
unique.term_list <- function(x, ...) {
349+
lapply(seq_along(x), \(i) x[i]) |> unique(...) |> do.call(c, args = _)
350+
}
351+
346352
#' @rdname term_list
347353
#' @export
348354
print.term_list <- function(x, ...){

man/term_list.Rd

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

0 commit comments

Comments
 (0)