@title Missing name in Roxygen
Asked Answered
B

3

5

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.

Broadbill answered 20/3, 2020 at 18:20 Comment(3)
I have the same problem. However I have no unusual comment at the end of my file and hence the provided answer doesnt fix this problem for me. I have many files, all following the same comment schema and non of them throws this kind of warning. Drives me mad...Hap
@Hap I'm not sure if I follow, you've said that they don't throw this warning. If you actually have this error check if one of the comment is missing @title. Also check if you don't have R6 classes they are handled differently. If you still have warning maybe you should ask another question, because here probably no one will give you one, it have answer and it's accepted.Broadbill
In case somebody else out there runs into this and maybe should just go to sleep...I was getting this error because I hadn't stored the function name. Instead of function(x){} I needed to put function_name<-function(x)Morph
B
5

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.

Broadbill answered 20/3, 2020 at 21:13 Comment(0)
C
1

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.

Cylinder answered 3/2, 2022 at 17:33 Comment(0)
I
0

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".

Instanter answered 2/6, 2022 at 7:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.