[Rd] single quotes in strings, example block

Duncan Murdoch murdoch.duncan at gmail.com
Thu Jul 31 11:55:31 CEST 2014


On 31/07/2014, 4:27 AM, Adrian Dușa wrote:
> Dear R-devel,
> 
> In the example block of the documentation for a package, I need to use
> a single quote in a string:
> 
>     foo <- "Don't know"
> 
> After building the package, it gets printed as:
> 
>     foo <- "Dont know"

I don't see this.  Can you give more details, i.e. R version, how you
printed it, etc.?

It may be that you're not using an ascii single quote character, your
editor has slipped in something else.

Duncan Murdoch

> 
> 
> I read the "Writing R Extensions" and "Parsing Rd files" from top to
> bottom, but didn't find any solution.
> 
> Using \verb{} doesn't help, as:
> Tag \verb is invalid in a \examples block
> 
> Neither \sQuote doesn't help, as:
> '\s' is an unrecognized escape in character string starting ""Don\s"
> 
> I found the only macros which are interpreted within text are \var and
> \link ... therefore I am stuck.
> 
> Any hint to other documentation I might read?
> Thank you,
> Adrian
>



More information about the R-devel mailing list