Closed fthalabi closed 3 years ago
Minimal example to reproduce the issue:
\usemodule[filter] \startbuffer[r::before] library(tidyverse) \stopbuffer \defineexternalfilter [R] [filtercommand={R CMD BATCH \externalfilterinputfile\space \externalfilteroutputfile}, output=\externalfilterbasefile.out, bufferbefore={r::before}, continue=no, read=no] \starttext \startR dt <- tibble(x = 1:5, y = x) plot <- ggplot(data = dt, mapping = aes(x = x, y = y, color = factor(x))) + geom_point() + labs(title = "áéíóú") ggsave('plot.pdf',plot = plot, device = cairo_pdf,width = 5,height=5,unit='cm') \stopR \externalfigure[plot.pdf] \stoptext
The context output:
The same R code run with Rscript gives:
I would be very grateful for any help in this issue, because i don't wanna waste anyone time i tried to solve it myself, but i couldn't.
Thanks in advance, Fernando H.
Most likely because the locale seen by context is different from your system locale. Try adding
locale
Sys.setlocale(category="LC_ALL", locale="en_US.UTF-8")
in r::before.
r::before
You are right, it works. Thanks.
Minimal example to reproduce the issue:
The context output:![image](https://user-images.githubusercontent.com/54052666/112708476-f2826a00-8e90-11eb-89b0-c63d602f44bf.png)
The same R code run with Rscript gives:
I would be very grateful for any help in this issue, because i don't wanna waste anyone time i tried to solve it myself, but i couldn't.
Thanks in advance, Fernando H.