I'm trying to use the package RIGHT, but my output is not the one shown on the package website (i.e. I can't access the interactive graphics).
library(RIGHT)
data(diamonds)
plot(price ~ carat, diamonds, type="p")
#THE ABOVE WORKS
RIGHT(plot(price ~ carat, diamonds, type="p"))
The above just returns a webpage without the graph with "© 2013 - The RIGHT team"
on the left and "E-mail : right-user#googlegroups.com" on the right. Basically the bottom of the last graph shown here.
I've tried to do this in the R console and in Rstudio and got the same output.
I'm running Windows 7 (64 bit), R version 3.0.2 (2013-09-25). I've also tried with previous R versions but got the same output. Has this happened to anyone else?
Thanks for using RIGHT. If you see a small box and the copyright statement from above statement, you may be experiencing browser compatibility issue. We have not been able to solve browser compatibility issue completely yet, so you probably have to do the following at the moment:
https://code.google.com/p/r-interactive-graphics-via-html/wiki/FAQs
Related
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="ক্ত", family="Kohinoor Bangla")
On my machine, the Bengali conjunct cluster "ক্ত" is rendered as its constituents plus a virana:
I have tried several different fonts to no avail. Is there a trick to making conjuncts render correctly?
EDIT:
Explicitly using the unicode still doesn't not render correctly:
This renders correctly for me:
print(stringi::stri_enc_toutf8("\u0995\u09cd\u09a4"))
This still gives me the exact same result as before
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="\u0995\u09cd\u09a4", family="Kohinoor Bangla")
Why is there a difference between the console output and ggplot output?
I'm not familiar with the Bengali language, but if you would look up the unicode characters for the text that you want to render, you could simply use those in geom_text()
# According to unicode code chart, these are some Bengali characters
# U+099x4
# U+09Ex3
ggplot(data=NULL,aes(x=1,y=1))+
# Substitute 'U+' by '\u', leave the 'x' out
geom_text(size = 10, label = "\u0994\u09E3")
Substitute the unicode characters as you see fit.
Hope that helped!
EDIT: I tried your last piece of code, which gave me a warning about the font not being installed. So I ran it without the family = "Kohinoor Bangla":
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="\u0995\u09cd\u09a4")
Which gave me the following output:
From a visual comparison with the character that you posted, it looks quite similar. Next, I ran the same piece of code on my work computer, which gave me the following output:
The difference between work and home, is that work runs on a linux, while home runs on windows, work has R 3.4.4, home has R 3.5.3. Both are in RStudio, both are ggplot 3.2.0. I can't update R on work because of backwards compatibility issues, to check wether the version of R might be the problem. However, you could check wether your version of R is older than 3.5.3 and see if updating relieves the problem. Otherwise, I would guess it is a platform issue.
I am using plotly in a project being used/run from windows/linux/mac machines. Generally this has been working fine, but I have an issue when trying to generate plotly plots from command line in windows.
As a reproducible example, following the code here:
install.packages("plotly")
library(plotly)
p <- plot_ly(midwest, x = ~percollege, color = ~state, type = "box")
p
Results in the error:
Error in shell.exec(url) :
access to '...\Local\Temp\Rtmpq42cvu\viewhtmla386dc27ae4/index.html' denied
That last backslash being the wrong way is an obvious candidate for the problem. And if I point my browser to the same file but with the last backslash changed to match the others, I see the plot as expected.
Could someone please check if they have the same problem? Note that I only have this problem when running from the command line. If I run the same code from Rstudio it works no problem. I'm on R version 3.4.0 and packageVersion("plotly") returns ‘4.6.0’.
Following the comment from #MikeWise (many thanks) I tried switching my default browser from firefox to chrome, and this fixed the issue.
Also, I have confirmed that this issue is also resolved by using an up-to-date version of firefox.
Whenever I plot any plot in RStudio, I get a new device window that pops up. This was not always the case. I must have changed some settings. How do I change the settings back to have plots go to the RStudio plot window?
I have explored the dev.off() and other dev functions without success. For example:
# Clear workspace
rm(list=ls())
# create data
set.seed(1)
x <- rnorm(100, 0, 1)
y <- rnorm(100, 3, 1)
plot(x,y)
produces the popped up window in the screenshotted image:
I want the device to stay in the RStudio plot window in the lower righthand corner. Does anyone have any help? I saw a similar question here that claims that an update will fix the issue. I updated within the last week. When I use sessionInfo() I am running R version 3.3.2, what I believe to be the latest version of R.
I know that this has been answered but the problem can arise in multiple ways. My issue had been much simpler. The plots were not showing up in the Rstudio plot pane simply because the default null GD was turned off via dev.off(). I'm running Rstudio Version 1.1.442 with R Version R-3.4.4
I ran dev.off() a few times until all windows including hidden ones were closed and I received the following response in the console window.
null device
1
I then ran this and the plot appeared in the RStudio plot pane
dev.new()
plot(mtcars$mpg~mtcars$disp)
For others who like me may still encounter this issue:
This is probably caused by an R update to 3.3.2 and is fixed by installing a newer version of RStudio. In my case 1.0.136 did the trick.
I solved this problem by updating RStudio (Help--> check for updates). The new version of RStudio I updated to is Version 1.1.383 and this problem was fixed. Currently I have version 3.4.3 for R.
Go to R studio menu bar and Tools->Global options->R Mark down
In that phase select "window" from that list in the "show output preview in:" then apply
When I run my code all my graphs (both ggplot2 and plot) are displayed in an external "Quartz 2 [*]" graphical viewer.
I would like them to be displayed in the R studio GUI plot area to I can better save and view my files, along with the previous versions.
Is there anyway to stop this?
I recently updated my version of R, along with the X11 and xQuartz on my mac (also up to date), and I am guessing these updates are behind it.
I have seen many forums explaining how to get rstudio to export to an external viewer (e.g. "quartz()"), but not the other way.
I have looked, but these threads have not helped:
ggplot plots in scripts do not display in Rstudio
plot panel does not produce plots Rstudio
dev.off() even when hidden hide <- dev.off() is not working either.
Any help would be great,
Thanks.
If you upgrade R without upgrading RStudio, the graphics engine may not be compatible. To fix the "Quartz 2" popout, upgrade RStudio to a newer version that supports the graphics engine in the version of R you have installed.
I had the same problem, and noticed the following output to the console:
Warning message:
R graphics engine version 15 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
Looks like I forgot to reinstall Rstudio as well.. That sorted my problem.
When I use the great package ggdendro to plot my tree, I come across a problem: One day, all labels of the tree it produces suddenly all disappeared.
When I run the following code in my local machine and in server, I get different results. No labels in local machine and labels do exist in the server version.
fit = ClustOfVar::hclustvar(X.quanti = mtcars)
ggdendro::ggdendrogram(as.dendrogram(fit),rotate = TRUE)
Server Version(OK):
Local Windows 7 Version(No labels):
I printed the session info as well for references.
dput compare(the same)
:
This issue has been fixed in the latest development version of ggdendro, version 0.1.19
The underlying issue is described at issue #24. This bug was exposed in a change of behaviour in ggplot2, and causes a problem with the scales package version 0.4. To be clear - the bug was in ggdendro, not ggplot2 or scales, but never surfaced when using earlier versions of scales.
This version is not yet on CRAN, so use devtools to get the latest version:
devtools::install_github("andrie/ggdendro")
Update. Version 0.1-20 of ggdendro is now available on CRAN.