From the course: R for Data Science: Lunch Break Lessons

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Evaluate the importance of a number with rank()

Evaluate the importance of a number with rank()

From the course: R for Data Science: Lunch Break Lessons

Evaluate the importance of a number with rank()

- [Instructor] The relationship between numbers in a data set is just as important as the values in a data set. Rank, an R language command, provides us with insight on how important a value is in the data set. Let's take a look. To demonstrate rank I need a vector, so I'll create one. And into it we'll place some numbers. C for combine one comma five comma five comma six comma seven. And you can see that a vector appears in the global environment. So we have five numbers, one, five, five, six, and seven. Let's do the easy thing and check the rank of a vector. And what this returns is how important a number is within relationship of that particular data set. What you're seeing is a list of five numbers, the first value of a vector, which is one, has a rank of one. Five has a rank of 2.5, and likewise the next five has a rank of 2.5. Six has a rank of four and seven has a rank of five. And what this…

Contents