R Program To Get the Unique Elements of a Given String and vector

R program to get the unique elements of a given string and unique numbers of vector: In this program, you will learn about the R program to get the unique elements of a given string and the unique number of the vector.

R Program To Get the Unique Elements of a Given String and vector

Source Code

number1 = "The quick brown fox jumps over the lazy dog."
print("(string)vector")
print(number1)
print("Unique elements of the vector=")
print(unique(tolower(number1)))
number2 = c(4, 2, 2, 7, 6, 4, 1, 6)
print("(number)vector")
print(number2)
print("Unique elements of the vector=")
print(unique(number2))

Output