Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roxygen 7.0.0 escapes % character to \\\% instead to \% in S4methods documentation. #976

Closed
lukasz-bednarz-reddeersystems opened this issue Nov 18, 2019 · 3 comments
Labels
bug an unexpected problem or unintended behavior rd ✍️
Milestone

Comments

@lukasz-bednarz-reddeersystems
Copy link

lukasz-bednarz-reddeersystems commented Nov 18, 2019

The \S4Method{...} entries in objects.md will have tripple \\\% escape. This makes R CMD check generating errors on missing method documentations and issues with finding references for @inheritParams.

``` library(roxygen2)

roc_proc_text(rd_roclet(), "
#' Operators for combining objects
#' @param x object of class derived from logical
#' @param y object of class derived from logical
#' @name operators
NULL
#' Combine
#'
#' @inheritParams operators
#'
#' @name intersection
#' @Rdname operators
#' @Aliases intersection_operator %&&%
#' @export
setGeneric('%&&%',
function(x, y){
standardGeneric('%&&%')
})
#' %&&% combine objects in an intersection
#'
#' @inheritParams operators
#' @Rdname operators
#' @Aliases intersection_operator %&&%
#' @export
setMethod('%&&%',
signature(x = 'logical',
y= 'logical'),
function(x, y){
object <- x && y
return(object)
}
)
")


# Roxygen 6.1.1


$operators.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in RtmpcDkoRi/file1b707fc45411
\docType{methods}
\name{operators}
\alias{operators}
\alias{intersection}
\alias{intersection_operator}
\alias{%&&%}
\alias{%&&%,logical,logical-method}
\title{Operators for combining objects}
\usage{
x %&&% y

\S4method{%&&%}{logical,logical}(x, y)
}
\arguments{
\item{x}{object of class derived from logical} \item{y}
{object of class derived from logical}
}
\description{
Operators for combining objects Combine %&&% combine objects
in an intersection
}


### R 7.0.0

$operators.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in ./
\name{operators}
\alias{operators}
\alias{intersection}
\alias{intersection_operator}
\alias{%&&%}
\alias{%&&%,logical,logical-method}
\title{Operators for combining objects}
\usage{
x %&&% y

\S4method{\%&&\%}{logical,logical}(x, y)
}
\arguments{
\item{x}{object of class derived from logical}

\item{y}{object of class derived from logical}
}
\description{
Operators for combining objects

Combine

%&&% combine objects in an intersection
}

Warning message:
Topic 'operators': no parameters to inherit with @inheritParams

  • Topic 'intersection': no parameters to inherit with @inheritParams
  • Topic '%&&%,logical,logical-method': no parameters to inherit with @inheritParams

<details>
@gaborcsardi

This comment has been minimized.

@lukasz-bednarz-reddeersystems

This comment has been minimized.

@hadley
Copy link
Member

hadley commented Nov 20, 2019

Minimal reprex:

library(roxygen2)
out <- roc_proc_text(rd_roclet(), "
setGeneric('%&&%', function(x, y) standardGeneric('%&&%'))
#' Title
#'
#' @export
setMethod('%&&%', signature('logical', 'logical'), function(x, y) {}
)
")
out[[1]]$get_section("usage")
#> \usage{
#> \S4method{\\\%&&\\\%}{logical,logical}(x, y)
#> }

Created on 2019-11-20 by the reprex package (v0.3.0)

@hadley hadley added bug an unexpected problem or unintended behavior rd ✍️ labels Nov 20, 2019
@hadley hadley added this to the v7.0.1 milestone Nov 20, 2019
@hadley hadley closed this as completed in ee061b3 Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd ✍️
Projects
None yet
Development

No branches or pull requests

3 participants