How to Apply the intersect() Function in R (Example Code)

In this R programming tutorial you’ll learn how to return the intersection of two data objects using the intersect function.

Example: Applying intersect() Function to Two Numerical Vectors

intersect(1:10, 5:20)        # Intersection of vectors
# [1]  5  6  7  8  9 10

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top