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

Bug Report: Error in base::file #12

Closed
JiaxiangBU opened this issue Aug 8, 2019 · 2 comments
Closed

Bug Report: Error in base::file #12

JiaxiangBU opened this issue Aug 8, 2019 · 2 comments

Comments

@JiaxiangBU
Copy link

JiaxiangBU commented Aug 8, 2019

Here is the reproducible minimal example.

library(demoR)
library(tidyverse)
demo_code('

iris %>%
  group_by(Species) %>%
  summarize(mean(Sepal.Length))

') %>%
  hlt_fixed("%>%")
iris %>%
group_by(Species) %>%
summarize(mean(Sepal.Length))
#> # A tibble: 3 x 2
#>   Species    `mean(Sepal.Length)`
#>   <fct>                     <dbl>
#> 1 setosa                     5.01
#> 2 versicolor                 5.94
#> 3 virginica                  6.59

Created on 2019-08-08 by the reprex package (v0.2.1)

image

It works well when I choose reprex to make a reproducible example. However, when I run the same code in a chunk of a Rmd document, I get this sort of error.

Error in base::file(file, encoding = encoding) : 'description'参数不对
```{r}
library(demoR)
library(tidyverse)
demo_code('

iris %>%
  group_by(Species) %>%
  summarize(mean(Sepal.Length))

') %>%
  hlt_fixed("%>%")
```

Here is the screenshot.

image

@kbodwin
Copy link
Owner

kbodwin commented Aug 8, 2019

Thank you so much for the heads up and the reprex!

I believe this is now fixed by 0edd78a

@kbodwin kbodwin closed this as completed Aug 8, 2019
@JiaxiangBU
Copy link
Author

It works with both reprex and rmarkdown::render.

library(demoR)
library(tidyverse)
#> Warning: 程辑包'ggplot2'是用R版本3.5.3 来建造的

#> Warning: 程辑包'tibble'是用R版本3.5.3 来建造的

#> Warning: 程辑包'tidyr'是用R版本3.5.3 来建造的

#> Warning: 程辑包'purrr'是用R版本3.5.3 来建造的

#> Warning: 程辑包'dplyr'是用R版本3.5.3 来建造的

#> Warning: 程辑包'stringr'是用R版本3.5.3 来建造的

#> Warning: 程辑包'forcats'是用R版本3.5.3 来建造的
demo_code('

iris %>%
  group_by(Species) %>%
  summarize(mean(Sepal.Length))

') %>%
  hlt_fixed("%>%")
iris %>%
group_by(Species) %>%
summarize(mean(Sepal.Length))
#> # A tibble: 3 x 2
#>   Species    `mean(Sepal.Length)`
#>   <fct>                     <dbl>
#> 1 setosa                     5.01
#> 2 versicolor                 5.94
#> 3 virginica                  6.59

Created on 2019-08-09 by the reprex package (v0.2.1)

---
author: Jiaxiang Li
date: "`r Sys.Date()`"
output: html_document
---

```{r}
library(demoR)
library(tidyverse)
demo_code('

iris %>%
  group_by(Species) %>%
  summarize(mean(Sepal.Length))

') %>%
  hlt_fixed("%>%")
```

image

Thanks a lot! @kbodwin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants