Arranging observations by life expectancy
You use arrange() to sort observations in ascending or descending order of a particular variable. In this case, you'll sort the dataset based on the lifeExp variable.
Bu egzersiz
Introduction to the Tidyverse
kursunun bir parçasıdırEgzersiz talimatları
- Sort the
gapminderdataset in ascending order of life expectancy (lifeExp). - Sort the
gapminderdataset in descending order of life expectancy.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
library(gapminder)
library(dplyr)
# Sort in ascending order of lifeExp
# Sort in descending order of lifeExp