x=c(5,5,5,5,5,5)
y=c(5,5)
z=c(3,5,5)
unique(x)
[1] 5
unique(y)
[1] 5
unique(z)
[1] 3 5
unique(x)==unique(y)
[1] TRUE
unique(x)==unique(z) #if sets are of different length we need to use all function
[1] FALSE TRUE
all(unique(x)==unique(z))
[1] FALSE
all(unique(x)==unique(y))
[1] TRUE
y=c(5,5)
z=c(3,5,5)
unique(x)
[1] 5
unique(y)
[1] 5
unique(z)
[1] 3 5
unique(x)==unique(y)
[1] TRUE
unique(x)==unique(z) #if sets are of different length we need to use all function
[1] FALSE TRUE
all(unique(x)==unique(z))
[1] FALSE
all(unique(x)==unique(y))
[1] TRUE
Немає коментарів:
Дописати коментар