Hi, I'm just about to install the Precompiled Binary Distribution of R from CRAN for SuSE Linux 8.2: R-base-1.7.1-1.i386.rpm My system is SuSE Linux 8.2 Professional Edition on a Pentium 4: # uname -a Linux linux 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003 i686 unknown unknown GNU/Linux 1) Problem: I've tried to install the above base rpm archive with the command: # rpm -i R-base-1.7.1-1.i386.rpm error: failed dependencies: libg2c.so.0 is needed by R-base-1.7.1-1 There seems to be only one dependency missing (hope that's all). Since I've installed the Professional Edition with all the compilers and libraries, it's maybe only a naming problem. What's behind this missing library? Can this problem be fixed with a symbolic link pointing to a library that I already have on my system? Any experience with that? Do you think I need or should compile and install R myself (not using one of the binary distributions)? 2) Question: I want to use R not only interactively (issue commands after the prompt > ..), but also use some functionality of R from a Perl script. Can I use methods of R from a Perl script: Is there an interface from Perl (or at least from C/C++) to R (f.e. invoke R functions from Perl, C, C++ or some other language)? If so, can you please point me to the documentation on the Web or in literature where this is decribed? Do you have some demo Perl script (or C/C++ program) that uses this technique, f.e. calling R methods like "mean" or "standard deviation"? Thanks's for your help! Regards Bernhard _________________ Dr. Bernhard Bals Dollmannstr. 6 D-81541 M?nchen +49-89-62509585 bbals at t-online.de
bbals at t-online.de (Bernhard Bals) writes:> Hi, > > I'm just about to install the Precompiled Binary Distribution of R > from CRAN for SuSE Linux 8.2: R-base-1.7.1-1.i386.rpm > > My system is SuSE Linux 8.2 Professional Edition on a Pentium 4: > > # uname -a > Linux linux 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003 i686 unknown > unknown GNU/Linux > > > 1) Problem: > > I've tried to install the above base rpm archive with the command: > > # rpm -i R-base-1.7.1-1.i386.rpm > error: failed dependencies: > libg2c.so.0 is needed by R-base-1.7.1-1 > > There seems to be only one dependency missing (hope that's all). Since > I've installed the Professional Edition with all the compilers and > libraries, it's maybe only a naming problem. > > What's behind this missing library? > Can this problem be fixed with a symbolic link pointing to a library > that I already have on my system? > Any experience with that?As far as I remember, this happens if you haven't installed the Fortran compiler (g77) since libg2c is part of that.> Do you think I need or should compile and install R myself (not using > one of the binary distributions)?Wouldn't help (except in the sense that it would become more obvious that a Fortran compiler is needed!)> > 2) Question: > > I want to use R not only interactively (issue commands after the > prompt > ..), but also use some functionality of R from a Perl script. > > Can I use methods of R from a Perl script: Is there an interface from > Perl (or at least from C/C++) to R (f.e. invoke R functions from Perl, > C, C++ or some other language)? > If so, can you please point me to the documentation on the Web or in > literature where this is decribed? > Do you have some demo Perl script (or C/C++ program) that uses this > technique, f.e. calling R methods like "mean" or "standard deviation"?http://www.omegahat.org/RSPerl . Be warned that these Omegahat packages are sometimes not quite as stable as the regular CRAN family of packages so some patchups can be required. Or maybe it will all just work... -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
It is a slow day, and those who really know the answers may not be around. So here goes. On 08/31/03 20:43, Bernhard Bals wrote:>Hi, ># rpm -i R-base-1.7.1-1.i386.rpm >error: failed dependencies: > libg2c.so.0 is needed by R-base-1.7.1-1 > >There seems to be only one dependency missing (hope that's all). Since >I've installed the Professional Edition with all the compilers and >libraries, it's maybe only a naming problem. > >What's behind this missing library?On my Red Hat System (noodle), I get: baron at noodle /usr/lib > "ls" -l libg2c* lrwxrwxrwx 1 root root 15 Apr 8 13:57 libg2c.so.0 -> libg2c.so.0.0.0 -rwxr-xr-x 1 root root 109976 Feb 25 2003 libg2c.so.0.0.0 In other words, it is linked to libg2c.so.0.0.0. Also, where does it come from? baron at noodle /usr/lib > rpm -q --whatprovides libg2c.so.0 libf2c-3.2.2-5 baron at noodle /usr/lib > rpm -ql libf2c /usr/lib/libg2c.so.0 /usr/lib/libg2c.so.0.0.0 In sum, it seems you need the rpm called libf2c.>Do you think I need or should compile and install R myself (not using >one of the binary distributions)?I have done this, and I do recommend it if you have a reasonably fast computer. But in this particular case, based on guesstimation from the name of the missing rpm, I bit you would need it anyway. Another way to find missing rpms is by typing in the name of the relevant file in the search section of http://rpmfind.net/linux/RPM/>2) Question: > >I want to use R not only interactively (issue commands after the prompt > > ..), but also use some functionality of R from a Perl script.It is better to ask one question per email. If this were the only one, I wouldn't answer. But I have noticed that Rweb uses Perl with R: http://www.math.montana.edu/Rweb/ There is also a CGIwithR package that I haven't tried, and I don't know what it does. -- Jonathan Baron, Professor of Psychology, University of Pennsylvania Home page: http://www.sas.upenn.edu/~baron R page: http://finzi.psych.upenn.edu/ deleting "Your details" "Your application" "Approved" "Thank you!"
Bernhard - 1) DO try building from source. For me it works painlessly (Redhat 8.0 linux) and ./configure seems to be very good at locating the resources it needs. 2) The very easiest, dumbest interface between Perl and R is for Perl to write an ascii file of R commands - exactly what one would type at the command line, including maybe 'object <- read.table("file.name")' to read in data from a second file - then run this script as: R BATCH scriptfile outfile. Wait for this to finish, then read outfile back into Perl. I can't help with fancier methods, since I've never tried. - tom blackwell - u michigan medical school - ann arbor - On Sun, 31 Aug 2003, Bernhard Bals wrote:> I'm just about to install the Precompiled Binary Distribution of R from > CRAN for SuSE Linux 8.2: R-base-1.7.1-1.i386.rpm > > My system is SuSE Linux 8.2 Professional Edition on a Pentium 4: > > # uname -a > Linux linux 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003 i686 unknown > unknown GNU/Linux > > 1) Problem: > > I've tried to install the above base rpm archive with the command: > > # rpm -i R-base-1.7.1-1.i386.rpm > error: failed dependencies: > libg2c.so.0 is needed by R-base-1.7.1-1 > > There seems to be only one dependency missing (hope that's all). Since > I've installed the Professional Edition with all the compilers and > libraries, it's maybe only a naming problem. > > What's behind this missing library? > Can this problem be fixed with a symbolic link pointing to a library > that I already have on my system? Any experience with that? > > Do you think I need or should compile and install R myself (not using > one of the binary distributions)? > > 2) Question: > > I want to use R not only interactively (issue commands after the prompt > > ..), but also use some functionality of R from a Perl script. > > Can I use methods of R from a Perl script: Is there an interface from > Perl (or at least from C/C++) to R (f.e. invoke R functions from Perl, > C, C++ or some other language)? > If so, can you please point me to the documentation on the Web or in > literature where this is decribed? > Do you have some demo Perl script (or C/C++ program) that uses this > technique, f.e. calling R methods like "mean" or "standard deviation"? > > Thanks's for your help! > _________________ > > Dr. Bernhard Bals > Dollmannstr. 6 > D-81541 München > +49-89-62509585 > bbals at t-online.de