Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use UTF-8 characters in dygraph title in R

Tags:

r

utf-8

dygraphs

Using Rstudio [Windows8], when I use the dygraph function to plot a time series, I have a problem when trying to use UTF-8 characters in the main title.

library(dygraphs)
dygraph(AirPassengers, main = "Título")

This results in a title: "T?tulo"

I have tried to convert "Título" to the utf-8 enconding, but it doesn't work.

like image 905
Vasco Avatar asked Sep 29 '22 13:09

Vasco


1 Answers

You can use enc2utf8.

dygraph(AirPassengers, main = enc2utf8("Título"))
like image 160
Michele Usuelli Avatar answered Oct 11 '22 10:10

Michele Usuelli