शुरू करेंमुफ़्त में शुरू करें

Add data to the R package

Now that you've created your unitConverter package, it's time to add some data. R packages aren't just for functions; they can also encapsulate related datasets.

Your manager has requested that you add a specific dataset to your package to convert the units. In this exercise, you will load this data from a CSV file named "distance_data.csv" into your unitConverter package.

The "distance_data.csv" file has been stored for you in the data-raw directory, and the readr package has been loaded for you.

यह अभ्यास पाठ्यक्रम का हिस्सा है

Developing R Packages

पाठ्यक्रम देखें

अभ्यास निर्देश

  • Read in and store the "data-raw/distance_data.csv" file as distance_data.
  • Show the first six rows of distance_data.
  • Load distance_data into the R package.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Read in distance data
___

# Print the first six rows of distance_data
___

# Add the distance data to the R package
___
कोड संपादित करें और चलाएँ