BaşlayınÜcretsiz Başlayın

Dört fiil arasından seçim yapmak

Bu bölümde dört fiili öğrendin: select(), mutate(), relocate() ve rename(). Burada, her durum için uygun fiili seçeceksin. Parantezlerin içindeki hiçbir şeyi değiştirmen gerekmeyecek.

Bu egzersiz

dplyr ile Veri Manipülasyonu

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • unemployment sütununun adını unemployment_rate olarak değiştirmek için doğru fiili seç.
  • Yalnızca state, county ve içinde poverty geçen sütunları tutmak için doğru fiili seç.
  • Nüfusta kadınların oranını gösteren fraction_women adlı yeni bir sütun hesapla; hiçbir sütunu düşürme.
  • Yalnızca üç sütun tut: state, county ve employed / population; bu sütuna employment_rate adını vereceksin.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Change the name of the unemployment column
counties %>%
  ___(unemployment_rate = unemployment)

# Keep the state and county columns, and the columns containing poverty
counties %>%
  ___(state, county, contains("poverty"))

# Calculate the fraction_women column without dropping the other columns
counties %>%
  ___(fraction_women = women / population)

# Move the region column to before state
counties %>%
  ___(region, .before = state)
Kodu Düzenle ve Çalıştır