Render japanese font in ggplot - r

I am creating a R shiny web app, which I have to publish in Japanese. The application plots many graphs, mainly using ggplot2.
After I run my application on my local machine, the browser renders all Japanese fonts in & outside ggplot correctly. However, when I upload it in shiny-apps, ggplot does not render Japanese text in Japanese characters.
I have already tried few tricks on stack overflow without any luck.
I am using a Windows machine, and have changed my local RStudio settings to utf8.
Shinyapps is by default utf8

Related

Plotly tooltip showing unicode character instead of letters in shiny server (R

I have a shiny application running in a shiny server that started giving errors for all accented characters today (it was working with no errors until yesterday night).
I realized that all files seemed to be sourced using other types of encoding than utf-8. Thus, I tried forcing it using source('file.R', encoding='utf-8') , but this gives an error and the application doesn't run.
Since I could not find the reason to why this was happening, I changed all characters to their unicode format (\u00xx) and used the enc2utf8 where needed.
After doing this, most of the application seemed to be working fine. The only problem that I am having now, is that the tooltip of my plotly charts started showing the unicode value instead of the character as shown in the image below. I tried not using the enc2utf8 on those dataframes but it also showed the characters with errors. For example, it should be Ăšltimo but it appears <c3><9a>ltimo when not using the enc2utf8.
How do I solve this problem? Is there a better way to force the files to be read in utf-8 instead of wharever encoding it is being read?
Extra information:
In RStudio I am saving all files as UTF-8 by default, so I assumed the encoding should not be an issue
In my local machine (windows) the application runs just fine and the plots are shown perfectly. The errors only occur on the server that runs in a linux machine

Plot encoding R

I worked on windows and I change to Linux. I would like to run my Rscript that I created on my windows cumputer to my Linux cumputer. When I run graphs, encoding is not good. I tried to create a html page. Title have a good encoding but not graphs. Do you have an idea to resolve my problem ?

Problem rendering R Plots output to png device in azure app service

I am working on migrating my on-premises asp.net app to azure app service. My app renders R plots as a PNG using R.net. I am packaging R software as a folder(not as installation) in my publish and updating R.net environment variables to use R libraries in that folder. This setup is working in an on-premises windows server:
While trying to render this in Azure app service using the same parameters as on-prem, it renders an error. The below specifies output at 300dpi:
If the output resolution is changed to 280dpi, the png image renders but is missing lots of legends and lines:
I tried setting type = "cario" for png device but not able to draw complete plot.
Other things tried:
Setting the output to a bitmap. Also renders a partial image, but different issues from the PNG. It renders the plot, but tiles of the image are missing, particularly on the right and bottom of the image
Setting the output to a pdf. Renders a complete image, but not in the format we want (PNG)
Any suggestions on rendering R plots from azure app service are well appreciated.

Shiny apps stuck in italics

I opened some Shiny apps today and discovered that, when I run them in RStudio, every piece of text in each of the apps was in italics -- in headers, select-input menus, and even data tables. Nothing in any of the apps is supposed to be (nor ever has been) italicized. The error occurs exclusively when I run the apps locally in RStudio; everything looks normal when I run it locally in a browser or when I go to the links where they are deployed.
Nothing in the files has changed since yesterday (when they were fully functional) and my RStudio is fully updated. I updated R and all the relevant packages but it did not make a difference.
Any idea what's going on or how to fix it?
Thanks!

In plotly (python API): How to enable latex rendering in offline mode?

I am using plotly version 1.9.3, and using it to embed figures in jupyter notebook in offline mode using
init_notebook_mode()
When I enter TeX notation in labels, titles, etc., the Tex will not render (i.e. $\alpha$ will be displayed as source.
When I use the "save and edit in cloud" toolbar option, in the plotly website it renders correctly.
Can I configure it to render also in the offline mode?
I have both LaTex installation and a local installation of MathJax.
At the moment, it unfortunately does not seem possible to configure plotly to properly render TeX notations in the offline mode. There is an open issue on their github repo with several users describing this problem.
For future reference, support was added for rendering LaTeX in offline mode in plotly.py version 3.4.0.
From https://github.com/plotly/plotly.py/blob/master/CHANGELOG.md#added:
Added LaTeX typesetting support for figures displayed in the Jupyter Notebook using plotly.offline.iplot and plotly.graph_objs.FigureWidget. Note: There are still outstanding issues with MathJax rendering in FireFox, but it is now working well in Chrome. (#1243)

Resources