Abdu Kikhia
Abdu Kikhia

Reputation: 105

Unable to add list under @format tag in package documentation

I'm trying to add dataset documentation to a function within my package, and followed the format roxygen2 provided about documenting other objects. However I keep getting an error after updating the package using devtools::document()

I'm trying to add documentation to a function within my package. I'm able to create the package successfully and on load able to use the functions too. I'm trying to document my dataset function and followed this format

#' @param data A data frame. See data_sample for formatting reference.
#' @format A data frame with the following columns:
#' \describe{
#'          \item{`Player Name`}{A chracter string. The name of the athlete}
#'          \item{`Age Group @ Testing`}{A chracter string. Athletes Age Group at the time of testing}
#'          \item{`Gender`}{A character String. The gender of the athlete}
#'          \item{`Testing Date`}{A date. The data collection date for each athlete}
#'          \item{`Birth Year`}{The year of birth for every athlete}
#' }

However I keep getting this error after running devtools::document() to update the package

Warning messages:
1: [maturation_cm.R:8] @format has mismatched braces or quotes

and sebsequently nothing is written for this in the .Rd file in the "man" folder.

I dont know if im formatting it wrong or what? this the first time I'm writing my own package

Upvotes: 0

Views: 37

Answers (2)

Abdu Kikhia
Abdu Kikhia

Reputation: 105

figured out that the @ symbol in \item{`Age Group @ Testing`} had to be replaced with 2 @ symbols to look like this \item{`Age Group @@ Testing`}.

also had a few % symbols that i had to escape with \%

Upvotes: 0

J_F
J_F

Reputation: 10372

Your problem here is the missing ending bracket for describe{. This bracket is never closed in y0ur code. Just add the last line of the following code and your example will work.

#' @format A data frame with the following columns:
#' \describe{
#'          \item{`Player Name`}{A chracter string. The name of the athlete}
#'          \item{`Age Group @ Testing`}{A chracter string. Athletes Age Group at the time of testing}
#'          \item{`Gender`}{A character String. The gender of the athlete}
#'          \item{`Testing Date`}{A date. The data collection date for each athlete}
#'          \item{`Birth Year`}{The year of birth for every athlete}
#'          }

Upvotes: 0

Related Questions