Last chance! 50% off unlimited learning
Sale ends in
intersect(A,B)
is a data frame with those rows that are both in A
and in B
.intersect(x, ...)
## S3 method for class 'default':
intersect(x, y, \ldots)
## S3 method for class 'data.frame':
intersect(x, y, \ldots)
## S3 method for class 'ps':
intersect(x, y, \ldots)
ps
objects containing a sequence of elements (conceptually).intersect
function in the base
package. The elements of intersect(x,y)
are those elements in x
and in y
. The original definition is preserved in the case that x
and y
are vectors of the same mode.union
, setdiff
S <- cards()
A <- subset(S, suit == "Heart")
B <- subset(S, rank == "A" )
intersect(A, B)
Run the code above in your browser using DataLab