﻿ R Programming: Find elements come only once that are common to both given data frames - w3resource

# R Programming: Find elements come only once that are common to both given data frames

## R Programming: Data frame Exercise-21 with Solution

Write a R program to find elements come only once that are common to both given data frames.

Sample Solution:

R Programming Code:

``````a = c("a", "b", "c", "d", "e")
b = c("d", "e", "f", "g")
print("Original Dataframes")
print(a)
print(b)
print("Find elements come only once that are common to both given dataframes:")
result = union(a, b)
print(result)
``````

Sample Output:

``` "Original Dataframes"
 "a" "b" "c" "d" "e"
 "d" "e" "f" "g"
 "Find elements come only once that are common to both given dataframes:"
 "a" "b" "c" "d" "e" "f" "g"
```

R Programming Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Test your Programming skills with w3resource's quiz.

What is the difficulty level of this exercise?

﻿