[R] ggplot2: qplot won't work

Ralf B ralf.bierig at gmail.com
Thu May 13 07:42:30 CEST 2010


I have a script running in the StatET Eclipse environment that
executes the ggplot2 command qplot in a function:

# Creates the plot
createPlot <- function(){
	print("Lets plot!")
	qplot(1:10, letters[1:10])
}

When executing the qplot line directly, it works. When executing the
script it does not open a window and it it does not plot. Is there
something important I have forgotten? I know that the function is
called because I always get my 'Lets plot'.... When using normal
graphics plot functions, its also works seamless.

Of course I am importing the library ggplot2 at the beginning of my
script - here is the import log:

 library(gdata)		# for trim function
gdata: Unable to locate valid perl interpreter
gdata:
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata:
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'


	The following object(s) are masked from package:utils :

	 object.size

Warning message:
package 'gdata' was built under R version 2.10.1
> library(TTR)		# for moving averages (SMA,...) smoothing
Loading required package: xts
Loading required package: zoo
Warning messages:
1: package 'TTR' was built under R version 2.10.1
2: package 'xts' was built under R version 2.10.1
3: package 'zoo' was built under R version 2.10.1
> library(ggplot2)	# for plotting results
Loading required package: proto
Loading required package: grid
Loading required package: reshape
Loading required package: plyr
Loading required package: digest

Attaching package: 'ggplot2'


	The following object(s) are masked from package:gdata :

	 interleave

Warning messages:
1: package 'ggplot2' was built under R version 2.10.1
2: package 'proto' was built under R version 2.10.1
3: package 'reshape' was built under R version 2.10.1
4: package 'plyr' was built under R version 2.10.1
5: package 'digest' was built under R version 2.10.1


What is wrong here?

Ralf



More information about the R-help mailing list