Skip to content

[R-pkg-devel] Rmarkdown vignette yields r inline warning on windows build

8 messages · Matthew Young, Max Turgeon, Spencer Graves +3 more

#
I am trying to submit a package to CRAN that includes a vignette built using rmarkdown.  It passes fine on the machines I have access to (ubuntu and osx).  When I submit to CRAN using the form, it passes the Debian checks, but fails on windows with the following WARNING:

! Missing $ inserted.
<inserted text>
                $
l.1030

You may need to add $ $ around a certain inline R expression `r `


I?m really not sure what is causing this error or how to debug it.  I do not have any inline r expressions in my vignette (code here https://github.com/constantAmateur/SoupX/blob/devel/vignettes/pbmcTutorial.Rmd).  I do have back-ticked expression such as `round`, but they are not executed code.  Can anyone suggest what might be causing this issue?

Many thanks,

Matthew
#
Since you're looking for suggestions and that's all I have:


Could it be the space between the tick mark and the r? For example, does replacing ` round` with `round` (and all other instances) fix the issue?


Max Turgeon
Assistant Professor
Department of Statistics
Department of Computer Science
University of Manitoba
maxturgeon.ca<http://maxturgeon.ca>
#
In R Markdown, you can say, "The number `r round(pi)` will appear as 
"The number 3".? If you write "`round`", it should display "round" in a 
special font for R commands.? Meanwhile "$\sigma > 2\Phi^{-1}(q)$" 
passes the string between the two dollar signs to a LaTeX processor.? If 
you already know this, I apologize for wasting your time with this 
reply.? If you did not know this, it might help you understand the 
problem.? Spencer Graves
On 2020-05-01 14:39, Max Turgeon wrote:

  
  
#
I?ve tried both ways (with and without a space after the backtick) and get the same error.

From: Max Turgeon <Max.Turgeon at umanitoba.ca>
Date: Friday, 1 May 2020 at 20:39
To: Matthew Young <my4 at sanger.ac.uk>, "r-package-devel at r-project.org" <r-package-devel at r-project.org>
Subject: Re: Rmarkdown vignette yields r inline warning on windows build [EXT]


Since you're looking for suggestions and that's all I have:



Could it be the space between the tick mark and the r? For example, does replacing ` round` with `round` (and all other instances) fix the issue?


Max Turgeon
Assistant Professor
Department of Statistics
Department of Computer Science
University of Manitoba
maxturgeon.ca [maxturgeon.ca]<https://urldefense.proofpoint.com/v2/url?u=http-3A__maxturgeon.ca&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=AbhQu2y3TVl5oJQLLYAJXIyLZredpV9XsmkkeGsu1Js&e=>
#
My wild guess is that 'r ' indicates there is an invisible char after 
the r that is not representable in the chosen encoding.

Best,
Uwe Ligges
On 02.05.2020 01:12, Matthew Young wrote:
1 day later
#
I progressively chopped bits out of the vignette till the error stopped to identify the error.  It was being caused by inline latex, where I had two %% marks.  I'm not really sure why this broke things, but removing it fixed it.

Thanks,

Matthew
?On 02/05/2020, 16:54, "Uwe Ligges" <ligges at statistik.tu-dortmund.de> wrote:
My wild guess is that 'r ' indicates there is an invisible char after 
    the r that is not representable in the chosen encoding.
    
    Best,
    Uwe Ligges
On 02.05.2020 01:12, Matthew Young wrote:
> I?ve tried both ways (with and without a space after the backtick) and get the same error.
    > 
    > From: Max Turgeon <Max.Turgeon at umanitoba.ca>
    > Date: Friday, 1 May 2020 at 20:39
    > To: Matthew Young <my4 at sanger.ac.uk>, "r-package-devel at r-project.org" <r-package-devel at r-project.org>
    > Subject: Re: Rmarkdown vignette yields r inline warning on windows build [EXT]
    > 
    > 
    > Since you're looking for suggestions and that's all I have:
    > 
    > 
    > 
    > Could it be the space between the tick mark and the r? For example, does replacing ` round` with `round` (and all other instances) fix the issue?
    > 
    > 
    > Max Turgeon
    > Assistant Professor
    > Department of Statistics
    > Department of Computer Science
    > University of Manitoba
    > maxturgeon.ca [maxturgeon.ca]<https://urldefense.proofpoint.com/v2/url?u=http-3A__maxturgeon.ca&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=AbhQu2y3TVl5oJQLLYAJXIyLZredpV9XsmkkeGsu1Js&e=>
    > 
    > 
    > 
    > ________________________________
    > From: R-package-devel <r-package-devel-bounces at r-project.org> on behalf of Matthew Young <my4 at sanger.ac.uk>
    > Sent: May 1, 2020 2:24:40 PM
    > To: r-package-devel at r-project.org
    > Subject: [R-pkg-devel] Rmarkdown vignette yields r inline warning on windows build
    > 
    > ********************************************************
    > Caution: This message was sent from outside the University of Manitoba.
    > ********************************************************
    > 
    > I am trying to submit a package to CRAN that includes a vignette built using rmarkdown.  It passes fine on the machines I have access to (ubuntu and osx).  When I submit to CRAN using the form, it passes the Debian checks, but fails on windows with the following WARNING:
    > 
    > ! Missing $ inserted.
    > <inserted text>
    >                  $
    > l.1030
    > 
    > You may need to add $ $ around a certain inline R expression `r `
    > 
    > 
    > I?m really not sure what is causing this error or how to debug it.  I do not have any inline r expressions in my vignette (code here https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwIDaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=ES3UP2LbqvhOCSwVRP53v_p9EkdNJSwmYuIlfmKly28&s=R9IaPh1UjnNyLSsE8CxG_GorvzRQPg8160TkSZoRoac&e=  [github.com]<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=1GWJLKyp3TJoM0X6-KWdkBEwtTer6JTOQKvF0d5iSPE&e=>).  I do have back-ticked expression such as `round`, but they are not executed code.  Can anyone suggest what might be causing this issue?
    > 
    > Many thanks,
    > 
    > Matthew
    > 
    > 
    > 
    > --
    >   The Wellcome Sanger Institute is operated by Genome Research
    >   Limited, a charity registered in England with number 1021457 and a
    >   company registered in England with number 2742969, whose registered
    >   office is 215 Euston Road, London, NW1 2BE.
    >          [[alternative HTML version deleted]]
    > 
    > ______________________________________________
    > R-package-devel at r-project.org mailing list
    > https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dpackage-2Ddevel&d=DwIDaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=ES3UP2LbqvhOCSwVRP53v_p9EkdNJSwmYuIlfmKly28&s=jHcMcn59Q1-o_syCiYCMbWM1iyrmJpxUICKHEcK4j9w&e=  [stat.ethz.ch]<https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dpackage-2Ddevel&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=aGl7Y0D-JZ1wiONI57CC8uOIDd4wneCjR-eCz6PZaVw&e=>
    > 
    > 
    >
1 day later
#
> I progressively chopped bits out of the vignette till the
    > error stopped to identify the error.  It was being caused
    > by inline latex, where I had two %% marks.  I'm not really
    > sure why this broke things, but removing it fixed it.

"fascinating" .. yes, unfortunately, the Rmarkdown related
engines (I suspect pandoc, but haven't thought or digged about it)
are clearly not bug free.

That's been my experience quite frequently when I "exaggerate"
in my use of LaTeX "tricks" in Rmarkdown documents ..

If somebody knows where exactly such cases should be sent, it
may help improving the situation.. I'm really no expert here.

Martin

    > Thanks,
    > Matthew

    > ?On 02/05/2020, 16:54, "Uwe Ligges"
> <ligges at statistik.tu-dortmund.de> wrote:
>     My wild guess is that 'r ' indicates there is an
    > invisible char after the r that is not representable in
    > the chosen encoding.
    
    >     Best, Uwe Ligges
> On 02.05.2020 01:12, Matthew Young wrote:
>> I?ve tried both ways (with and without a space after the
    >> backtick) and get the same error.
    >> 
    >> From: Max Turgeon <Max.Turgeon at umanitoba.ca> Date:
    >> Friday, 1 May 2020 at 20:39 To: Matthew Young
    >> <my4 at sanger.ac.uk>, "r-package-devel at r-project.org"
    >> <r-package-devel at r-project.org> Subject: Re: Rmarkdown
    >> vignette yields r inline warning on windows build [EXT]
    >> 
    >> 
    >> Since you're looking for suggestions and that's all I
    >> have:
    >> 
    >> 
    >> 
    >> Could it be the space between the tick mark and the r?
    >> For example, does replacing ` round` with `round` (and
    >> all other instances) fix the issue?
    >> 
    >> 
    >> Max Turgeon Assistant Professor Department of Statistics
    >> Department of Computer Science University of Manitoba
    >> maxturgeon.ca
    >> [maxturgeon.ca]<https://urldefense.proofpoint.com/v2/url?u=http-3A__maxturgeon.ca&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=AbhQu2y3TVl5oJQLLYAJXIyLZredpV9XsmkkeGsu1Js&e=>
    >> 
    >> 
    >> 
    >> ________________________________ From: R-package-devel
    >> <r-package-devel-bounces at r-project.org> on behalf of
    >> Matthew Young <my4 at sanger.ac.uk> Sent: May 1, 2020
    >> 2:24:40 PM To: r-package-devel at r-project.org Subject:
    >> [R-pkg-devel] Rmarkdown vignette yields r inline warning
    >> on windows build
    >> 
    >> ********************************************************
    >> Caution: This message was sent from outside the
    >> University of Manitoba.
    >> ********************************************************
    >> 
    >> I am trying to submit a package to CRAN that includes a
    >> vignette built using rmarkdown.  It passes fine on the
    >> machines I have access to (ubuntu and osx).  When I
    >> submit to CRAN using the form, it passes the Debian
    >> checks, but fails on windows with the following WARNING:
    >> 
    >> ! Missing $ inserted.  <inserted text> $ l.1030
    >> 
    >> You may need to add $ $ around a certain inline R
    >> expression `r `
    >> 
    >> 
    >> I?m really not sure what is causing this error or how to
    >> debug it.  I do not have any inline r expressions in my
    >> vignette (code here
    >> https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwIDaQ&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=ES3UP2LbqvhOCSwVRP53v_p9EkdNJSwmYuIlfmKly28&s=R9IaPh1UjnNyLSsE8CxG_GorvzRQPg8160TkSZoRoac&e=
    >> [github.com]<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_constantAmateur_SoupX_blob_devel_vignettes_pbmcTutorial.Rmd&d=DwMF-g&c=D7ByGjS34AllFgecYw0iC6Zq7qlm8uclZFI0SqQnqBo&r=XXcY8t_J1mVMCDTmi3629g&m=KD5hkiMRJXvOAV1srKNufKVz3MOekQAmaDIOmgmxB6A&s=1GWJLKyp3TJoM0X6-KWdkBEwtTer6JTOQKvF0d5iSPE&e=>).
    >> I do have back-ticked expression such as `round`, but
    >> they are not executed code.  Can anyone suggest what
    >> might be causing this issue?
    >> 
    >> Many thanks,
    >> 
    >> Matthew
    >> 
    >> 
    >> 
    >> --
    >> The Wellcome Sanger Institute is operated by Genome
    >> Research Limited, a charity registered in England with
    >> number 1021457 and a company registered in England with
    >> number 2742969, whose registered office is 215 Eu...{{dropped:26}}
#
On 05/05/2020 10:30 a.m., Martin Maechler wrote:
We don't have anything to send, so it's hard to say where to send it.

Put together a minimal reproducible example, and it'll probably be easy 
to work out whether it's R, R Markdown, knitr, Pandoc, or LaTeX that has 
the bug.

(Naturally I suspect it's not R, and past experience makes me think it's 
not LaTeX, but there are still three other possibilities in the list.)

Duncan Murdoch