Implemented basic functionality of setdiff
This commit is contained in:
parent
f28bf5d763
commit
eba8705d9e
2 changed files with 24 additions and 4 deletions
13
R/setdiff.R
Normal file
13
R/setdiff.R
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#' @title Set differences of two arrays
|
||||
#' @description Loosely replicates the behavior of the homonym Matlab function
|
||||
#' @param A first array
|
||||
#' @param B second awway
|
||||
#' @param legacy if `TRUE`, preserves the behavior of
|
||||
#' @return
|
||||
#' @author Waldir Leoncio
|
||||
#' @export
|
||||
setdiff <- function(A, B, legacy = FALSE) {
|
||||
values <- sort(unique(A[is.na(match(A, B))]))
|
||||
# browser() # TEMP
|
||||
return(values)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue