Plot encoding R - 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 ?

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

Jupypter Notebook in VS Code won't compile Latex Code

I'm new to programming and this forum. My problem is that latex code in markdown cells in a Jupypter notebook opened in vs code won't compile properly. I know that there are several threads already here in this forum and in the internet, but nothing worked so far.
I got to the point where I completely reinstalled my macbook.
So I run the latest VS Code Version on High Sierra, Python is installed via condo and my vs code extensions are python from microsoft and the Jupypter extension.
When VS code is newly installed first everything works but the second time the layout of the Jupyter notebooks changes and latex code won't compile any more.
So The first picture is how it looks on my computer, the second is how it should look. I also recognize, the look of the notebook is slightly different as kernel and host information are (in the second photo) visualized on top of the notebook - below the tabs there is a bar that show the information and also the play sign and so on to run cells.
The weird thing is, that in the beginning, first time after complete installation, on my computer it looked like it should, second time (and every time after that) it changed and it's not working any more without me changing anything.
Does anybody have a clue how to solve this problem?
Thanks a lot!
first pic - my computer
second pic - how it should look

Why don't R Notebooks save/embed outputs in the file or R Project?

When I send or receive an R notebook, or even an R Project (from RStudio), the R notebook doesn't maintain any of the outputs; neither printed text or graphics show up, and the whole notebook has to be re-run to show the outputs. Is there some kind of setting I can turn on to make sure the outputs are embedded in the R Notebook so that I can send the notebook to someone else, like with Jupyter notebooks?
As per the official RStudio community blog here (and my own experience with RStudio), this is not possible.
The RStudio blog's Sustainer however brought up two good points (although it does not solve your problem):
If the purpose is to create a reproducible example, the reprex package is the way to go. This is great for short bits of r code and output.
You should also check our rmarkdown notebooks. Note that even with R's file >> save feature, you won't save plots etc. With rmarkdown or rmarkdown notebooks, you can intermix markdown formatted text, code, and code output (including tables and plots). You then also may knit that into html or pdf documents.
EDIT: if you are not tied up to RStudio, you can use JupyterLab instead (a powerful extension of Jupyter Notebooks - from the same project team). JupyterLab is language(kernel)-agnostic and does run nicely with R. All your work, included outputs, can then be fully saved - as you are familiar with in the Python world.
I used a cloud-based version of R JupyterLab hosted on GCP (Google Cloud Platform) but I am sure it can be deployed on your preferred environment as well (open source project, flexible, well supported by the Community).
Reference here
Kernel-backed documents enable code in any text file (Markdown, Python, R, LaTeX, etc.) to be run interactively in any Jupyter kernel.

Running two instances of Rstudio simultaneously on Linux

I've got a lengthy process running in Rstudio and I would like to open a separate session of Rstudio while the first one is running. I know I can run R from the command line to get as many sessions as I want, but I wanted to know if it is possible for me to do this in Rstudio on a Linux computer. Thanks.
#infominer suggested a good solution, which is to simply type rstudio in the command line. That's what I ended up doing
Another convenient way to deal with this is to start a seperate R-instance in the terminal by typing simply
R
and from there just run the script that has a lengthy process with
source("path-to-your-script/your-script.R")
you can than continue to edit and work with your two scripts in the already opened R-Studio editor window.

Problems working with Rgui in Win7.64-bit...gibberish non-english characters

I have some problems with the execution of R GUI in Windows 7/64-bit. It appears gibberish while running R terminal sounds ok. here are the pictures of the two. I searched the web but I have no clue.

Resources