@title Missing name in Roxygen

2.4k Views Asked by At

I have documentation for R6Class:

#' Root component that don't have parent,
#'
#' It should not be used directly, only using \code{\link{pkg::component}} function.
#'
#' @name BaseComponent
#' @importFrom R6 R6Class
#' @docType class

#' @keywords components, architecture, structure

and roxygen show warning:

Warning: [c:\projects\pkg\R\components.R:1] @title Missing name

I have no idea why it show line number 1, my code is not at line 1.

Adding @title don't change anything I keep getting this warning.

3

There are 3 best solutions below

0
jcubic On BEST ANSWER

Warning was confusing the last line of the file had this:

#' init extend on base battery component
BaseComponent$extend <- make.extend(BaseComponent)

replacing #' with ## fixed the issue.

0
LMc On

I had this same issue. It was cause by the following line of code in the same file as a package function:

utils::globalVariables(c("."))

Which I had used because of the warning no visible binding for global variable ‘.’

After moving that line to its own file in my R folder I no longer had the message.

0
Stefan Jelkovich On

In my case the warning showed up because of a non-ASCII-character in the @example-part:

#' @examples
#' \dontrun{
#' find_address(state = "Bayern",
#'              org = "Universität",  <-- the "ä" is the causing the warning
#'              page_size = 10)
#' }

roxygenise is fine now with the example parameter org = "Hochschule".