1. Learn
  2. /
  3. Courses
  4. /
  5. Data Science Visualization - Module 2

Exercise

Exercise 3. Numerical values

Keep in mind that discrete numeric data can be considered ordinal. Although this is technically true, we usually reserve the term ordinal data for variables belonging to a small number of different groups, with each group having many members.

The height variable could be ordinal if, for example, we report a small number of values such as short, medium, and tall. Let's explore how many unique values are used by the heights variable. For this we can use the unique function:

x <- c(3, 3, 3, 3, 4, 4, 2)
unique(x)

Instructions

100 XP

Use the unique and length functions to determine how many unique heights were reported.