From ihaka@stat.auckland.ac.nz  Thu Aug 21 10:44:05 1997
From: ihaka@stat.auckland.ac.nz (Ross Ihaka)
Date: Thu, 21 Aug 1997 21:44:05 +1200 (NZST)
Subject: R-alpha: thoughts on batch and fortran
Message-ID: <199708210944.VAA22730@stat1.stat.auckland.ac.nz>

	From r-devel-owner@stat.math.ethz.ch Thu Aug 21 19:40 NZS 1997
	From: Jim Lindsey <jlindsey@luc.ac.be>
	Subject: R-alpha: thoughts on batch and fortran
	To: r-devel@stat.math.ethz.ch (r-devel)
	Date: Thu, 21 Aug 1997 09:44:35 +0200 (MET DST)

	Batch:
	  For me, batch in its present state is broken and useless. My primary
	need for batch is to produce a final output file of a session after I
	have worked out a sequence of procedures. I save my instructions in a
	file that I can source, then run it in batch to have a copy of input
	and output together. (If there was a log file (or dribble), this
	problem would be solved.) At present, there are two problems with batch:
	(1) I always run R interactively with saving the .RData shut off. This
	is not possible in batch. Robert promised that it would be changed in
	R0.14 but that never occurred so I am obliged to modify the C code of
	each new version of R to avoid the problems of rereading .RData that I
	described at that time.

The problem is that we had requests both ways - i.e. saving and not
saving.  Sorry, but we can't do it both ways.  But, if you end your
input file with
	q(save=FALSE)
you will get the effect you want.

	(2) In any case, since 0.49, I cannot use batch because, as soon as
	it hits a plot instruction, it stops with an error.

If you are plotting you will need to be running a device driver
of some sort.  In batch we don't automatically run any.
You can put either
	x11()
or
	postscript()
at the top of the file you are running to get a driver started.
Perhaps I will look at creating a "dummy" do-nothing driver which
will be run by default in batch mode.

	Fortran:
	I think that, if .Fortran is to exist, then the full fortran library
	(except I/O) should be available, not just those functions required by
	the basic R. I am thinking in particular of the complex functions that
	I require for Kalman filtering in carma (soon to be released as a
	dynamic library). Having the full f2c library linked in (-lf2c, when it
	works under Linux - see the recent comments of my son, Patrick) does
	not take more space unless it is actually used because it is dynamic.
	carma will not work without these functions so how can I release
	something that will not work for most users?

We've been talking about this a bit - its a general problem.
I will look and see if we can package the f2c library as an R library.
Then we could say
	library("f2c")
	library("carma")
I don't know if this will work - i.e. whether functions in carma.so
will "see" functions in f2c.so.  If I get a second in the next couple of
days I will try the experiment.
	Ross
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: thoughts on batch and fortran
Ross Ihaka