Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline code and as.roman #1625

Closed
rgaiacs opened this issue Oct 29, 2018 · 3 comments
Closed

Inline code and as.roman #1625

rgaiacs opened this issue Oct 29, 2018 · 3 comments
Labels
bug Bugs
Milestone

Comments

@rgaiacs
Copy link

rgaiacs commented Oct 29, 2018

knitr has the correct output of as.roman for code blocks but not for inline code.

Minimal working example

---
title: "Bug"
author: "Raniere Silva"
date: "29 October 2018"
output: html_document
---

```{r}
v <- c(104, 97, 108, 108, 111, 119, 101, 101, 110)
v
```

```{r}
as.roman(v)
```

Inline: `r as.roman(v)`

Expected Output

``` {.r}
v <- c(104, 97, 108, 108, 111, 119, 101, 101, 110)
v
```

    ## [1] 104  97 108 108 111 119 101 101 110

``` {.r}
as.roman(v)
```

    ## [1] CIV   XCVII CVIII CVIII CXI   CXIX  CI    CI    CX

Inline: CIV. XCVII, CVIII, CVIII, CXI, CXIX, CI, CI, CX

Output with version 1.20

``` {.r}
v <- c(104, 97, 108, 108, 111, 119, 101, 101, 110)
v
```

    ## [1] 104  97 108 108 111 119 101 101 110

``` {.r}
as.roman(v)
```

    ## [1] CIV   XCVII CVIII CVIII CXI   CXIX  CI    CI    CX

Inline: 104, 97, 108, 108, 111, 119, 101, 101, 110
@yihui yihui added the bug Bugs label Nov 1, 2018
@yihui
Copy link
Owner

yihui commented Nov 1, 2018

Before the bug is fixed, you have to use as.character(as.roman()). Thanks for the report!

@yihui yihui added this to the v1.21 milestone Dec 10, 2018
@yihui yihui closed this as completed in 08c666a Dec 10, 2018
@yihui
Copy link
Owner

yihui commented Dec 10, 2018

Should be fixed now. Thanks again for the report!

@github-actions
Copy link

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs
Projects
None yet
Development

No branches or pull requests

2 participants