I have a function that does nothing more than ads a unique attr
to any R object. Base demo:
#' Setter function
#' @param x an R object
#' @param value a character value to set
#' @export
`foo<-` <- function(x, value){
attr(x, 'foo') <- value
return(x)
}
This works like a charm except for generating a good Rd file, relevant part:
\usage{
foo(var, value) <- value
}
And of course it triggers a warning while running R CMD check
as it should be foo(var) <- value
.
Any hints would be really apprecieted!
Update: thanks to richierocks it seems there is a fix
You can use the roxygen tag
@usage
Here is an example from one of my packages:
This results in my desired documentation: