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

Applying the unit conversion

Now that you've written some functions, it's time to apply them! The NASS corn dataset is available, and you can fortify it (jargon for "adding new columns") with metrics areas and yields.

This fortification process can also be turned into a function, so you'll define a function for this, and test it on the NASS wheat dataset.

Bu egzersiz, kursun bir parçasıdır

Introduction to Writing Functions in R

Kursa Göz Atın

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# View the corn dataset
glimpse(corn)

corn %>%
  # Add some columns
  ___(
    # Convert farmed area from acres to ha
    farmed_area_ha = ___(___),
    # Convert yield from bushels/acre to kg/ha
    yield_kg_per_ha = ___(
      ___,
      crop = "___"
    )
  )
Kodu Düzenle ve Çalıştır