Document your data
Documenting data in R package development is crucial as it provides essential information about the datasets included in the package. Proper documentation helps users understand the structure, content, and intended use of the data, enabling them to make informed decisions and effectively utilize the package's functionality.
Recall the distance_data data set you loaded into the package earlier in the course.
The testthat package and the unitConverter package at this point in development have been loaded for you. You are currently working in the R/distance_data.R file that was created with use_r("distance_data").
本练习是课程的一部分
Developing R Packages
练习说明
- Update the heading to have a title of
Distance values and unitsand a description ofDistance values and corresponding unit (feet, meters, or inches) - Update the
@formatentry to beData frame with two columns and 1000 rows. - Change the
\describeportion to includevalueandunitas\items withNumeric distance valueandDistance unitas information. - Add an
@examplesentry showing how to printdistance_dataand close the file with the name of the data in a string.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Add header and description
___
___
___
# Update format
___
# Document column names and information
#' \describe{
___
___
#' }
# Add example and string of data name
___
___
___