Skip to content

installing R packages in Windows?

9 messages · Brian Ripley, Guido Masarotto, A.J. Rossini +3 more

#
On Sat, Nov 21, 1998 at 11:54:09PM +0100, Peter Dalgaard BSA wrote:
I am not really a MsWindows programmer so I will try to summarize
  what I know hoping that others (Luke?) will suggest the right direction.

  There are two possibilities easy to implement but not completly
  satisfactory:
  1) to build a only `stdio`  executable, i.e., to have an executable
     which behaves as when you start the Unix one with the 
     --no-readline flag; I suppose that this can be used with ESS
     but I don't use Emacs under Windows so I don't know
     how Emacs manages sub-processes. This new exe must be called
     R.exe (as the other one; if you change the name you will
     have to provide different dll's; which is not what we want;
     but if it is called R.exe (-> it cannot be put
     in RHOME/bin) it can share all the other files). Surely, it 
     will be possible to do batch processing like under Unix
     (redirection provides by the shell from which you launch it).
     I have no tried but this would require minimal change (I suppose
     that I can have it in less than 1 hour); so, if someone wants
     to test it, just ask. 
  2) to add batch processing to the actual executable,i.e, to let 
     possible to launch R with a command line of the type
     R --input-from afile --output-to anotherfile
     In this case, no console is open and R will run in background
     (maybe it can open a small window just saying 
      "R is running; this is the moment for a cup of coffee"
      we need it I think (at least to be able to kill the
      process)). If you will not use the command line arguments
      the standard console will open. R.exe will be a standard
      Windows executable (no character console, no stdin/stout/stderr)
      -> no ESS support.

   On the other end, the ideal solution will be to have an executable
   which on demand (i.e., using the --no-readline flag, I suppose)
   will or open the graphics console or use `stdio`.
   Somewhere in the Win32 API must exist something which let this.
   But I have to find out where. Perhaps, someone here can help
   Problem is that standard Windows application are either
   
   (i) completly `windowed', like Robert's and mine version of R;
   in this case, they don't have standard input and output; 
   indeed if you launch  it from a character console, they behave
   more or less  as if, under Unix, you launch an application
   from an xterm using the background flag (&) 
   and with stdin and   stdout redirected to /dev/null;
   
   or
   
   (ii) `console` applications; in this case stdin and stdout are there;
   but the side effect is that they ALWAYS open a character console
   (or `lock` the one from which you have launched them); 
   
   g.
   
   
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Sun, 22 Nov 1998, Guido Masarotto wrote:

            
I am much, much less of an MS windows programmer than Guido.  What I
intended to try to do was: 

(i) build almost all of R as a DLL. I think that is easy given what
Guido has done, and then other DLLs can link against the import library
for that DLL.  We just need a DLL version of R.a and a different libR.a
(I think).

(ii) build two front-ends called say Rconsole.exe and Rbatch.exe to drive
that DLL.

If it helps, S-PLUS 4.5 has essentially both Guido's options 1) (sqpe.exe)
and 2) (Splus /BATCH) and I use 1) almost all the time.
Yes, please, and I think that would suffice for ESS if we are careful
about prompts and stdout/stderr.  I don't care if the x11() device is not
active in this mode.  An ESS insider should be able to advise exactly what
is required; the problem with sqpe.exe is that the prompts disappear
if input is redirected.
1 day later
#
I made an experiment along the way suggested by Brian Ripley (thanks...).
1) I put all the code in a big dynamic library (R.dll, ~900K);
2) I prepare two executable (4K each,i.e, the smallest size possible
    under Windows): (i) a 'windowed' application (rconsole.exe) which should
    behaves like my current version and (ii) a 'console' (I suppose
    that a better name for rconsole is needed) application
    (rbatch.exe) which does not open a graphich console but
    use 'stdio'. I didn't test Emacs+ESS since, after some
    bad (but old) experiences, I use Emacs
    only under Unix; however, at least, `rbatch < afile > anothefile'
    seems to work; in addition, when isatty() is false (I expect
    this happening under Emacs) the code is exactly the Unix one.
    
I have just uploaded  the result (two files: rw63-iob.zip, binaries,
also of the standard dll's linked against the new R.dll but no help,...
and rw63-ios.zip, sources) on ftp://stat.unipd.it/users/guido/R/devel 
(during the night the files should be mirrored to Wien).

I hope someone would test this version since, if it works,
I think that can add something to the current one (in particular,
if starting from this version we can obtaning an executable
working under Emacs).
But be aware: (i) it is the result of 2 hour of works on a train;
                                                      ~~~~~~~~~~
(ii) I have only test it on a Win98 notebook; (iii) as
Luke said, rbatch should not work under Win32s; (iv) Brian's
libraries must be rebuilt to make them working with this version.

guido
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Guido Masarotto <guido@sirio.stat.unipd.it> writes:
Thanks much.  I'm hacking Emacs/ESS on MS Windows platforms starting
mid next month, thanks to some external prodding (and now, product
availability from both R, Splus).  And I think XLispStat might be able
to talk (at least DDE), as well, which would be nice

If anyone evaluates the situation before then (ESS/Emacs/R on MS
Windows 95/98/NT), please send me some email with comments, to help me
out! (MS isn't my native environment by a long shot :-).

best,
-tony
#
Guido Masarotto <guido@sirio.stat.unipd.it> writes:
Sounds great, except for the naming... The terminology seems to be
that one distinguishes between GUI applications and console
applications, and your GUI app. is the one called Rconsole! And Rbatch
also works interactively...

More obvious would be to call them

Rgui and Rconsole
   or maybe
Rgui and R
#
On 23 Nov 1998, Peter Dalgaard BSA wrote:

            
Peter, what you and what Windows call a `console application' clearly
differ!  In Windows a `console application' opens its own window to work
in.

Given that confusion, I would go for something like Rgui and Rterm (as for
now R is already used for the `all in one' solution).

The point here is that if the DLL is called R.DLL, we can make different
front ends and link them to everything else, and the names can be changed.

Congratulations to Guido: I failed in a couple of hours, because a crucial
link step always hangs my machine. (Ah, the joys of MS programming.)
#
Prof Brian D Ripley <ripley@stats.ox.ac.uk> writes:
Hm. I think you're wrong there, although there's an obvious ambiguity
between programs that need a console and those that supply one. A
console *mode* application is definitely something that is intended to
be run in a console (alias DOS box in W95), and a GUI mode application
runs detached, like a background job in Unix. The former are the ones
that spring up a DOS box when you double-click the icon, and the
latter is the only type that runs in Win32s.
Rterm is a good idea, certainly.
#
I don't understand the behavior of "as.list"
(really as.list.default) on arguments which
are expressions. An artificial example:
[[1]]
<-

[[2]]
<-

as.list.default contains the following code:

 if (is.expression(x)) {
        l <- vector("list")
        for (sub in x) l <- c(l, sub[[1]])

--- why the sub[[1]] part?

eliminating the [[1]], I get:
[[1]]
x <- 1

[[2]]
y <- 2


Kjetil Halvorsen
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
I have a very basic implementation of sockets adapted from Luke Tierney's
XLISP-Stat implementation. It will probably be in R0.64 but that could be
some time coming.  In the interim I have an R package at
	http://www.biostat.washington.edu/~thomas/sockets.tgz

It should also work with S once you work out the right compiling and
linking flags. 


Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._