1

I am new to R and want to use the Eclipse plugin StatEt with Oxygen.2 Release (4.7.2) on Windows 7.

I tried to create an example plot with the R Graph Builder. I click the "play button" and get following output on the R Code tab. Furthermore, I hear a "ping" sound.

library(ggplot2)

p <- ggplot(data = mtcars, aes(x = mpg, y = cyl))
p <- p + labs(title = "test")

print(p)

However, I can not see any graph.

=> Is the purpose of the "play action" only to produce the console output?

enter image description here

=> Where can I find documentation about the Graph Builder?

=> What data can I enter to get a first example graph?

Furthermore, when I plot a graph in StatEt, I would expect its output to be in the view "R Graphics". However, a new window is opened by R. I have the option "Set R Graphic view by StatET as default graphic device for new plots in R" enabled on the tab "R Console" in my console run configuration.

=> What is the purpose of the "R Graphics" view?

Example plots:

x<-c(1:10)
y<-sin(x)       
plot(x=x,y=y)

-

library(ggplot2)
ggplot(data = mtcars,aes(x=wt))+geom_bar()

Related questions:

Stefan
  • 10,010
  • 7
  • 61
  • 117

1 Answers1

1
  • In order to use those features of StatEt you need to select RJ (default) instead of Rterm in the Console run configuration. (Rterm might be useful for trouble shooting and initial setup but RJ is required for normal usage. The R package RJ needs to be installed from within R. Apply Rterm once for doing so or use R.exe directly. Also see ClassNotFoundException for StatEt Eclipse plugin / RJ. Compatibility issue with Java9?)

  • RJ 2.1 is not compatible to Java 9. Currently you need to install Java8 and select it in the JRE settings of the run configuration.

  • Make sure that the box Set R Graphic view by StatET as default graphic device for new plots in R is checked in Run configuration>R console. (It is checked by default.)

enter image description here

Once you have created your graph, the example code is written in code. This is normally sent to the R console. You should now be able to see the graphical result in the R Graphics view.

enter image description here

Stefan
  • 10,010
  • 7
  • 61
  • 117
Cedric
  • 2,412
  • 17
  • 31
  • I have the option enabled and tried your input settings. The output to the "R Console" tab (marked red in your screenshot) works. However, I can't see some output in the extra console view (green font in your example) nor can I see the graphical output in the "R Graphics" view. Instead I hear the ping - (Error sound?). Maybe the graphical output does not work on Windows. Do you use a Linux OS? – Stefan Jan 04 '18 at 09:17
  • 1
    From what I remember you had trouble to install the rJ dependency no ? I think it might be linked. Have you managed to make it work ? – Cedric Jan 04 '18 at 09:43
  • I did not manage to use RJ yet. I'll try again. Related question: https://stackoverflow.com/questions/3727822/how-does-one-install-rj-in-statet-plugin-for-eclipse – Stefan Jan 04 '18 at 10:23
  • I'm willing to help you there. I'll post a comment on your rj question – Cedric Jan 04 '18 at 11:44
  • I created a new question here: https://stackoverflow.com/questions/48096198/classnotfoundexception-for-statet-eclipse-plugin-rj-compatibility-issue-with – Stefan Jan 04 '18 at 13:17