[R] problems on JGR package and demo() function in Ubuntu linux

Mao Jianfeng jianfeng.mao at gmail.com
Mon Apr 12 10:44:15 CEST 2010

Dear R-helpers

I want to express my respect and thankfulness to all of you. I have
ever ask this question about one hour ago. Following Mr. Henrik
Bengtsson's advice I re-submit this query here.

I just switch from windows xp to Ubuntu linux platform. I am facingtwo
problems when I run R in Ubuntu.

I need your helps and advice, thanks in advance.

1. R session info
> sessionInfo()
R version 2.10.1 (2009-12-14)

[1] en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] JavaGD_0.5-2 rJava_0.8-3

loaded via a namespace (and not attached):
[1] tcltk_2.10.1 tools_2.10.1

2. problem 1: JGR package can not be loaded in R session properly
> library(JGR)
Loading required package: rJava
Loading required package: JavaGD
Loading required package: iplots
Error in .jnew("org/rosuda/iplots/Framework") :
 java.awt.AWTError: Cannot load AWT toolkit: gnu.java.awt.peer.gtk.GtkToolkit
Error: package 'iplots' could not be loaded
> traceback()
3: stop(gettextf("package '%s' could not be loaded", pkg), call. = FALSE,
      domain = NA)
2: .getRequiredPackages2(pkgInfo)
1: library(JGR)

3. problem 2: demo() just can return a blank window-board
> demo(graphics)

       ---- ~~~~~~~~

Type  <Return>   to start :

> require(datasets)

> require(grDevices); require(graphics)

> ## Here is some code which illustrates some of the differences between
> ## R and S graphics capabilities.  Note that colors are generally specified
> ## by a character string name (taken from the X11 rgb.txt file) and that line
> ## textures are given similarly.  The parameter "bg" sets the background
> ## parameter for the plot and there is also an "fg" parameter which sets
> ## the foreground color.
> x <- stats::rnorm(50)

> opar <- par(bg = "white")

> plot(x, ann = FALSE, type = "n")
Hit <Return> to see next plot:
Error in plot.new() : attempt to plot on null device
> traceback()
7: plot.new()
6: plot.default(x, ann = FALSE, type = "n")
5: plot(x, ann = FALSE, type = "n")
4: eval.with.vis(expr, envir, enclos)
3: eval.with.vis(ei, envir)
2: source(available, echo = echo, max.deparse.length = Inf, keep.source = TRUE)
1: demo(graphics)


Jian-Feng, Mao
the Institute of Botany, CAS
Beijing, China

More information about the R-help mailing list