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

Converting yields to metric

The yields in the NASS corn data are also given in US units, namely bushels per acre. You'll need to write some more utility functions to convert this unit to the metric unit of kg per hectare. This time it'll be a harmonic method to account for bigger differences in numbers.

Bushels historically meant a volume of 8 gallons, but in the context of grain, they are now defined as masses. This mass differs for each grain! To solve this exercise, you need to know these facts.

  1. One pound (lb) is 0.45359237 kilograms (kg).
  2. One bushel is 48 lbs of barley, 56 lbs of corn, or 60 lbs of wheat.

magrittr is loaded.

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.

# Write a function to convert lb to kg
lbs_to_kgs <- ___
Kodu Düzenle ve Çalıştır