ourMELONS/R/mysubset.R
2022-12-22 13:31:41 +01:00

13 lines
330 B
R

mysubset <- function(small, large) {
# MYSUBSET Is the small set of + ve integers a subset of the large set?
# p <- mysubset(small, large)
# Surprisingly, this is not built - in.
if (is.null(small)) {
p <- 1# is.null(large)
} else {
p <- length(myintersect(small, large)) == length(small)
}
return(p)
}