เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Adding and testing a new function in the package

Another colleague has requested that the unitConverter package you've been working on expand its functionality. In this exercise, you will add a new function weight_converter that converts between different weight units. You'll then check to make sure all the package files load as expected.

The devtools and usethis packages have been loaded for you. The weight_converter function has been provided for you.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Developing R Packages

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Find appropriate pounds
weight_converter(100, unit_from = ___, unit_to = ___)
แก้ไขและรันโค้ด