Escaping "@" in Roxygen2 Style Documentation
Asked Answered
P

1

21

Let's say I have a comment block where I'd like to write an email address. How would I go about escaping the "@" symbol so roxygen treats it as text instead of a directive?

Pammy answered 10/1, 2012 at 19:7 Comment(0)
S
22

A double at-sign @@ will do the job.

As an example, take the email address in the author field of this documentation:

##' A package to check Roxygen's sanity.
##' @name helloRoxygen-package
##' @docType package
##' @author My name \email{me@@here.org}
NA

which produces this *.Rd file when processed with roxygenize():

\docType{package}
\name{helloRoxygen-package}
\alias{helloRoxygen-package}
\title{A package to check Roxygen's sanity.}
\description{
  A package to check Roxygen's sanity.
}
\author{
  My name \email{[email protected]}
}
Saltine answered 10/1, 2012 at 19:32 Comment(2)
Be nice to note here how @ symbols handled when accessing slots in @example code.Gyral
@Gyral -- How are they handled? Do they require special treatment, or have the roxygen authors just allowed example code to be passed along verbatim?Moretta

© 2022 - 2024 — McMap. All rights reserved.