R I want to remove those red lines - r

I want to remove those red lines in r studio.
I upgraded to the latest version, according to someone's suggestion.
But it is not working.
The problem occurs when I write Korean words.
The default encoding is UTF-8.
I found a similar problem here, but it didn't work for me.
https://community.rstudio.com/t/why-and-where-is-a-an-unexpected-token-in-r-and-how-should-i-deal-with-it/26496/4
df$번호
df$이름
df$성별

This is a bug -- unfortunately, the RStudio diagnostics system does not correctly handle multibyte characters in R Markdown documents on Windows. This will hopefully be fixed in the next release (v1.3).

Related

Problem with find and replace in R Editor

I am currently using R (RGui; R version 4.2.1). I use 'find' and 'replace' in R Editor a lot. Recently, both will only work for one character. So I can find 'a' but it won't find any instances of 'aaa' even if I know they exist. I'd be really happy if anyone can suggest a solution as it's driving me crazy. Thanks!
This was recently fixed in Rgui for Windows. I am using "R version 4.2.1 Patched (2022-09-28 r82941 ucrt)" and it works (using ctrl-h or the Edit menu in the Rgui R Editor).
In the BUG FIXES on Windows subsection within the section CHANGES IN R 4.2.1 patched of https://cran.r-project.org/doc/manuals/r-devel/NEWS.html it says:
Find and replace operations work again in the script editor in Rgui on Windows.
Same problem - with R 4.2.1 I cannot find and replace using the R editor. I had to close the script up and do it in .txt.
I have the same issue. R version 4.2.1 on Windows 10. It doesn't find anything I search for, even if I can see it right there on the screen. Not even single-character strings. I was editing a non-R file.

R pander doesn't show result with accentuated character

I've worked for some months with pander/rmarkdown/rstudio without problem, but on this new machine, something as simple as
library(pander)
cars$test="qsdféé"
pander(cars)
give me back "Error in table.expand(x, t.width, justify, sep.col) :
basic_string::_S_create"
I don't understand, because on my previous machine, it works without a flaw.
Same pander version (0.6.0), same configuration of Rstudio (default encoding utf-8), windows 7 on both sides.
It's quite strange because pander has no problem if I have only one accentuated character (car$test="qsdfé") but it's the second that trigger the problem.
In rmarkdown, it makes the compiler stop instantly, with no error message.
This is a bug, which doesn't have a solution (other than reverting R-version) as of now. There is an open issue on github: Link
Issue #296

Arabic text not showing in R-

Just started working with R in Arabic as I plan to do text analysis and text mining with Hadith corpus. I have been reading threads related to my question but nevertheless, still can't manage to get the REAL basics here (sorry, absolute beginner).
So, I entered:
textarabic.v <- scan("data/arabic-text.txt", encoding="UTF-8", what= "character",sep="\n")
And what comes out textarabic.v is of course, symbols (pic). Prior to this, I saved my text in utf-8 as I read in a thread but still nothing shows in Arabic.
I can type in Arabic R but scan brings the text in symbols.
Also read and tried to implement other user's are codes to make Arabic text function but I don't even know how and where to implement them.
I added to R, tm and NLP packages.
What do you suggest for me to do next?
Thanks in advance,
I just posted an answer saying that you must definitely be using R on Windows before I saw your comment that you're on OSX. On OSX the situation is not quite so dire. The problem is that you're using too old a version of R. If I right remember, anything prior to 3.2 does not handle Unicode correctly. Try installing 3.3.3 from https://cran.r-project.org/bin/macosx/ and if necessary re-install the packages you need. Then you should be fine. بالتوفيق!

R studio graph not appearing in plots window

I am having trouble getting my graphs to appear in the 'plots' window of R studio - once I run the script they appear in a separate R graphics window, separate to R Studio, with the 'plots' tab blank.
Is there a setting or code I should use to change this?
Thank you in advance,
This has been a consistent problem for many users ever since the last couple updates, myself included. It was apparently fixed with 3.5 version of R, which I haven't updated to, but you didn't mention which version you are running.
Either way, if you're running the most updated version or not, try getOption("device") and check the output of that. Per an R support community post, if the output does not say RStudioGD, you can use options(device = "RStudioGD").
The NEXT, and more annoying, solution was to uninstall and reinstall RStudio. Many people found that this solved their problem.
If neither of those work work, the only other solution that people were finding is to downgrade your R version to a compatible version unfortunately! It's really annoying, I know!
Hope I could help!

invalid multibyte character crashes when script is loaded from source (umlauts / special characters)

EDIT:
Thx to suggestions from the mailing list I realized that the problem I got has nothing to do with Sweave or Latex. It´s some Mac OS X related issue. Whenever I run my script by selecting all and sending it to R it works.
When I use
source("myplainRcode.R")
i get the error message stated below
finally I got sweave working together with ggplot2 on my Mac OS X. I invoke Sweave inside R with
Sweave("myfile.Rnw")
which creates the desired latex output. Now that the basic tests work, I try to source my real world file and it crashes at the following line:
gl_bybranch = ddply(new_wans,.(period,Branchen),
function(X)data.frame(Geschäftslage=mean(X$sentiment)))
I guess it has either to do with the ".(period...)" or the "ä" . Unfortunately I can't change these labels because they are also used in legends. So, somewhere in my code these ugly umlauts will appear. Is there a way to escape them in Sweave? I can't believe that this is problem since Sweave is written by a German who probably have second most umlaut characters (behind Turkey).
The error message I get is: invalid multibyte character in Parser on line 195
Thx for any ideas in advance!
YAY ! i got it. Sorry for the noise everybody. I switched all three files (.Rnw, mysource.R , invokeSweave.R) to UTF-8 it finally worked. So everybody who works with Komodo on a Mac make sure to change your default encoding to UTF-8 !

Resources