Re: [R-pkg-devel] Rmarkdown fails if (quote) r (space) is used

2023-11-03 Thread J C Nash

Yes. An initial space does the trick. Thanks. J

On 2023-11-03 11:48, Serguei Sokol wrote:

Le 03/11/2023 à 15:54, J C Nash a écrit :

I've spent a couple of hours with an Rmarkdown document where I
was describing some spherical coordinates made up of a radius r and
some angles. I wanted to fix the radius at 1.

In my Rmarkdown text I wrote

    Thus we have `r = 1` ...

To avoid a confusion between inline code and fixed font typesetting, could it be

    Thus we have ` r = 1` ...

(with a space after an opening quote)?

Best,
Serguei.



This caused failure to render with "unexpected =". I was using Rstudio
at first and didn't see the error msg.

If I use "radius R" and `R = 1`, things are fine, or `r=1` with no space,
but the particular "(quote) r (space)" seems to trigger code block processing.

Perhaps this note can save others some wasted time.

I had thought (obviously incorrectly) that one needed ```{r something}
to start the code chunk.

JN

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel




__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Rmarkdown fails if (quote) r (space) is used

2023-11-03 Thread Serguei Sokol

Le 03/11/2023 à 15:54, J C Nash a écrit :

I've spent a couple of hours with an Rmarkdown document where I
was describing some spherical coordinates made up of a radius r and
some angles. I wanted to fix the radius at 1.

In my Rmarkdown text I wrote

    Thus we have `r = 1` ...
To avoid a confusion between inline code and fixed font typesetting, 
could it be


   Thus we have ` r = 1` ...

(with a space after an opening quote)?

Best,
Serguei.



This caused failure to render with "unexpected =". I was using Rstudio
at first and didn't see the error msg.

If I use "radius R" and `R = 1`, things are fine, or `r=1` with no space,
but the particular "(quote) r (space)" seems to trigger code block 
processing.


Perhaps this note can save others some wasted time.

I had thought (obviously incorrectly) that one needed ```{r something}
to start the code chunk.

JN

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Rmarkdown fails if (quote) r (space) is used

2023-11-03 Thread Jeff Newmiller via R-package-devel
A code chunk does always begin with a triple backtick at the beginning of a 
line. The term for what you encountered is "inline code" used to embed computed 
results into the markdown text as though you had typed them directly.

Check out 
https://www.r-bloggers.com/2017/12/how-to-show-r-inline-code-blocks-in-r-markdown
 for relevant discussion.

On November 3, 2023 7:54:22 AM PDT, J C Nash  wrote:
>I've spent a couple of hours with an Rmarkdown document where I
>was describing some spherical coordinates made up of a radius r and
>some angles. I wanted to fix the radius at 1.
>
>In my Rmarkdown text I wrote
>
>   Thus we have `r = 1` ...
>
>This caused failure to render with "unexpected =". I was using Rstudio
>at first and didn't see the error msg.
>
>If I use "radius R" and `R = 1`, things are fine, or `r=1` with no space,
>but the particular "(quote) r (space)" seems to trigger code block processing.
>
>Perhaps this note can save others some wasted time.
>
>I had thought (obviously incorrectly) that one needed ```{r something}
>to start the code chunk.
>
>JN
>
>__
>R-package-devel@r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Sent from my phone. Please excuse my brevity.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Rmarkdown fails if (quote) r (space) is used

2023-11-03 Thread J C Nash

I've spent a couple of hours with an Rmarkdown document where I
was describing some spherical coordinates made up of a radius r and
some angles. I wanted to fix the radius at 1.

In my Rmarkdown text I wrote

   Thus we have `r = 1` ...

This caused failure to render with "unexpected =". I was using Rstudio
at first and didn't see the error msg.

If I use "radius R" and `R = 1`, things are fine, or `r=1` with no space,
but the particular "(quote) r (space)" seems to trigger code block processing.

Perhaps this note can save others some wasted time.

I had thought (obviously incorrectly) that one needed ```{r something}
to start the code chunk.

JN

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel