roxygen2 long section title

Hello,

at the top of all of my R files for a given project I generally add a @section roxygen2 tag to group all the the documented functions in that file together in the manual output document.

I am also using the goodpractice package to check for potential issues in my package. One of the issues that goodpractice is reporting is that I have a long @section tag that is longer than 80 characters long.

avoid long code lines, it is bad for readability. Also, many people prefer editor windows that are about 80 characters wide. Try to make your lines shorter than 80 characters

Without shortening the @section title is there a way to deal with this issue. Is there a line break character that we can use in roxygen2?

I guess you can simply split your line over multiple lines. As long as you don't have an empty line in between, everything will be shown as a single line.

#' @section This is a long sentence that is more than eighty-character long and 
#'   split over multiple lines.

Looking at the documentation, it's now recommended to use a level 1 heading with # rather than using @section.

1 Like