Skip to content

Special characters in reprex #252

@filipwastberg

Description

@filipwastberg

I was trying to post an issue for another package about special characters when my reprex() failed because of those characters:

reprex::reprex({
  
  library(dplyr)
  
  iris %>% 
    mutate(Species = gsub("a", "å", Species)) %>% 
    group_by(Species) %>% 
    count()
  
})   

The output from the reprex is:

library(dplyr)

iris %>% 
  mutate(Species = gsub("a", "
#> Error: <text>:5:30: unexpected INCOMPLETE_STRING
#> 4: iris %>% 
#> 5:   mutate(Species = gsub("a", "
#>                                 ^

The code runs fine outside of the reprex, any idea why it fails inside?


R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Swedish_Sweden.1252  LC_CTYPE=Swedish_Sweden.1252    LC_MONETARY=Swedish_Sweden.1252
[4] LC_NUMERIC=C                    LC_TIME=Swedish_Sweden.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1        ps_1.3.0          packrat_0.5.0     digest_0.6.18     R6_2.4.0          reprex_0.2.1.9000
 [7] evaluate_0.13     rlang_0.3.4       fs_1.2.6          callr_3.1.1       whisker_0.3-2     rmarkdown_1.12.6 
[13] tools_3.5.3       xfun_0.6          compiler_3.5.3    processx_3.3.0    clipr_0.5.0       htmltools_0.3.6  
[19] knitr_1.22      

Metadata

Metadata

Assignees

No one assigned

    Labels

    encoding �reprexneeds a minimal reproducible example

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions