WinVector / wrapr

Wrap R for Sweet R Code
https://winvector.github.io/wrapr/
Other
136 stars 11 forks source link

Character encoding causes order to error-out #9

Closed JohnMount closed 5 years ago

JohnMount commented 5 years ago

From: https://github.com/WinVector/cdata/issues/6 .

Only happens in knitr or reprex contexts:

ct = data.frame(
  variable = c("privée", "publique"),
  value = c("privée", "publique"),
  stringsAsFactors = FALSE
)
wrapr::has_no_dup_rows(ct)
#> Error in (function (..., na.last = TRUE, decreasing = FALSE, method = c("auto", : Character encoding must be UTF-8, Latin-1 or bytes

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

JohnMount commented 5 years ago

Found the issue radix sort method plus knitr. The following Rmarkdown shows the problem.

---
title: "Runs in console, but won't knit"
output: html_document
---

```{r, error=TRUE}
ct = data.frame(
  variable = c("privée", "publique"),
  value = c("privée", "publique"),
  stringsAsFactors = FALSE
)

do.call(order, as.list(ct))

do.call(order, c(as.list(ct), list(method = "radix")))
JohnMount commented 5 years ago

Fixed our issue with https://github.com/WinVector/wrapr/commit/53ed02e9848e36b754af1726848233641c7ed1ea and filed underlying issue as https://github.com/yihui/knitr/issues/1690 .