Get the App
SLTechnology News&Howtos  ›  Development  › 

How to obtain the intersection and Union of two Array Vectors in R language

Shulou Source: shulou.com Published: 2022-06-02 01:13:02 09月20日 Update

This article mainly introduces "how R language obtains the intersection and union of two array vectors". In daily operation, I believe that many people have doubts about how R language obtains the intersection and union of two array vectors. The editor consulted all kinds of data and sorted out simple and useful operation methods. I hope it will be helpful for you to answer the questions of "R language how to obtain the intersection and union of two array vectors"! Next, please follow the editor to study!

Intersection can be done with intersect union. For example, union can be used for two vectors: > A=LETTERS [1:10] > B=LETTERS [5:15] # # intersection > intersect (AMagi B) [1] "E".

How to obtain the intersection and union between two vectors in R language?

Intersection can be done with intersect

Union can be done with union

For example, for the two vectors of An and B:

> A=LETTERS [1:10] > B=LETTERS [5:15] # # intersection > intersect (AMagi B) [1] "E", "F", "G", "H", "I", "J" # # Union > union (AMague B) [1] "A", "B", "C", "D", "E", "F", "G", "H", "I" J "K", "L", "M", "N"O"

These two functions can only operate on two vectors, not on three vectors directly.

At this point, the study of "how to obtain the intersection and union of two array vectors in R language" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Two intersection vector language array learning more help practical next three between functions articles methods theory knowledge articles websites materials Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MySQL vpn Shulou Tech Info Apple