Escaping “@” in Roxygen2 Style Documentation

后端 未结 1 1598
不知归路
不知归路 2020-12-10 11: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 directi

相关标签:
1条回答
  • 2020-12-10 11:42

    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{me@here.org}
    }
    
    0 讨论(0)
提交回复
热议问题