How to find out the range of vectors given below using R?

926    Asked by shukhdevsingh in Data Science , Asked on Dec 12, 2019
Answered by Nitin Solanki

(1, 8, 2, 6, 3, 8, 5, 5, 5, 5)

To find out the range of vectors, we need to find out the maximum and minimum of numbers.Let us assign to a variable x

x=c(1, 8, 2, 6, 3, 8, 5, 5, 5, 5)

Now range is known as the difference between maximum and minimum of numbers.So we can use the following to find out the range

range=max(x)-min(x)



Your Answer

Interviews

Parent Categories