2022-12-22 13:18:54 +01:00
|
|
|
mysubset <- function(small, large) {
|
2022-12-22 13:31:41 +01:00
|
|
|
# MYSUBSET Is the small set of + ve integers a subset of the large set?
|
|
|
|
|
# p <- mysubset(small, large)
|
2022-12-22 13:18:54 +01:00
|
|
|
|
2022-12-22 13:31:41 +01:00
|
|
|
# Surprisingly, this is not built - in.
|
2022-12-22 13:18:54 +01:00
|
|
|
|
2022-12-22 13:31:41 +01:00
|
|
|
if (is.null(small)) {
|
|
|
|
|
p <- 1# is.null(large)
|
|
|
|
|
} else {
|
|
|
|
|
p <- length(myintersect(small, large)) == length(small)
|
|
|
|
|
}
|
|
|
|
|
return(p)
|
2022-12-22 13:18:54 +01:00
|
|
|
}
|