Translated mysubset()
This commit is contained in:
parent
73438af7bb
commit
a757a4435c
1 changed files with 9 additions and 9 deletions
18
R/mysubset.R
18
R/mysubset.R
|
|
@ -1,13 +1,13 @@
|
|||
mysubset <- function(small, large) {
|
||||
# function p=mysubset(small,large)
|
||||
# % MYSUBSET Is the small set of +ve integers a subset of the large set?
|
||||
# % p = mysubset(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.
|
||||
# Surprisingly, this is not built - in.
|
||||
|
||||
# if isempty(small)
|
||||
# p = 1; % isempty(large);
|
||||
# else
|
||||
# p = length(myintersect(small,large)) == length(small);
|
||||
# end
|
||||
if (is.null(small)) {
|
||||
p <- 1# is.null(large)
|
||||
} else {
|
||||
p <- length(myintersect(small, large)) == length(small)
|
||||
}
|
||||
return(p)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue