Skip to content

Exporting from Splus into R

11 messages · Brian Ripley, Ernesto Jardim, M. Edward (Ed) Borasky +3 more

#
Hi

I want to export an array (dim=c(24,12,17)) from splus into R. I've
tried dump but R couldn't source it.

Is there a fast and clean way of doing this ?

Thanks

EJ

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Prof Brian D Ripley wrote:

            
Yes I can source it in Splus but R says
Error in eval.with.vis(expr, envir, enclos) :
        couldn't find function "new"


I think I'll try the write(as.vector()) and scan.

Thanks

EJ

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Tue, 3 Apr 2001, [iso-8859-1] José Ernesto Jardim wrote:

            
What happened?  Can you source it in S-PLUS?
data.dump in S-PLUS  and data.restore in package Rstreams should work ....

Otherwise just write() it as a vector, scan as a vector and add a
dimension.
#
On Tue, 3 Apr 2001, [iso-8859-1] José Ernesto Jardim wrote:

            
That looks like a bug: can you send the example to R-bugs please.
#
Prof Brian D Ripley wrote:

            
Yes, I'll do that !

EJ

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
I can't seem to get the "e1071" package to build. Here is a Linux log; the
Windows version behaves the same way:
--------------------------------------------------------------------------
# R CMD INSTALL e1071*.gz
Installing source package `e1071' ...
creating cache ./config.cache
checking for library containing pnm_readpnm... no
checking for library containing pbm_readpbm... -lpbm
checking for library containing pgm_readpgm... -lpgm
checking for library containing ppm_readppm... -lppm
checking for library containing pnm_writepnm... -lpnm
updating cache ./config.cache
creating ./config.status
creating R/pnm.R
creating src/Makevars
 libs
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
 -fPIC  -O2 -march=i386 -mcpu=i686 -c Rsvm.c -o Rsvm.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
 -fPIC  -O2 -march=i386 -mcpu=i686 -c cmeanscl.c -o cmeanscl.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
 -fPIC  -O2 -march=i386 -mcpu=i686 -c cshell.c -o cshell.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
 -fPIC  -O2 -march=i386 -mcpu=i686 -c pnm.c -o pnm.o
In file included from /usr/include/pbm.h:7,
                 from /usr/include/pgm.h:7,
                 from /usr/include/ppm.h:7,
                 from /usr/include/pnm.h:7,
                 from pnm.c:19:
/usr/include/pbmplus.h:305:20: shhopt.h: No such file or directory
make: *** [pnm.o] Error 1
ERROR: Compilation failed for package `e1071'
#
--------------------------------------------------------------------------
znmeb at aracnet.com (M. Edward Borasky) http://www.aracnet.com/~znmeb

Never play leapfrog with a unicorn.

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
MEB> I can't seem to get the "e1071" package to build. Here is a
    MEB> Linux log; the Windows version behaves the same way:

I'm not seeing that, R 1.2.2, Debian i386-Linux, unstable (sid):


500# R INSTALL e1071_1.1-0.tar.gz 
Installing source package `e1071' ...
creating cache ./config.cache
checking for library containing pnm_readpnm... no
checking for library containing pbm_readpbm... -lpbm
checking for library containing pgm_readpgm... -lpgm
checking for library containing ppm_readppm... -lppm
checking for library containing pnm_writepnm... -lpnm
updating cache ./config.cache
creating ./config.status
creating R/pnm.R
creating src/Makevars
 libs
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES  -fPIC  -g -O2 -c Rsvm.c -o Rsvm.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES  -fPIC  -g -O2 -c cmeanscl.c -o cmeanscl.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES  -fPIC  -g -O2 -c cshell.c -o cshell.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES  -fPIC  -g -O2 -c pnm.c -o pnm.o
gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES  -fPIC  -g -O2 -c scaclust.c -o scaclust.o
c++ -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp  -fPIC  -g -O2 -c svm.cpp -o svm.o
c++ -shared  -o e1071.so Rsvm.o cmeanscl.o cshell.o pnm.o scaclust.o svm.o -L/usr/local/lib -lpnm -lppm -lpgm -lpbm  
 R
 help
 >>> Building/Updating help pages for package `e1071'
     Formats: text html latex example 
  Discrete                          text    html    latex   example
  Mvnorm                            text    html    latex   example
  bincombinations                   text    html    latex   example
  bootstrap.lca                     text    html    latex   example
  classAgreement                    text    html    latex   example
  cmeanscl                          text    html    latex   example
  countpattern                      text    html    latex   example
  cshell                            text    html    latex   example
  element                           text    html    latex   example
  hamming.distance                  text    html    latex   example
  hamming.window                    text    html    latex   example
  hanning.window                    text    html    latex   example
  ica                               text    html    latex   example
  impute                            text    html    latex   example
  interpolate                       text    html    latex   example
  kurtosis                          text    html    latex   example
  lca                               text    html    latex   example
  matchClasses                      text    html    latex   example
  moment                            text    html    latex   example
  permutations                      text    html    latex   example
  plot.fclust                       text    html    latex   example
  plot.stft                         text    html    latex   example
  pnm                               text    html    latex
  predict.svm                       text    html    latex   example
  print.fclust                      text    html    latex   example
  rbridge                           text    html    latex   example
  read.octave                       text    html    latex
  rectangle.window                  text    html    latex   example
  rwiener                           text    html    latex   example
  scaclust                          text    html    latex   example
  sigmoid                           text    html    latex   example
  skewness                          text    html    latex   example
  stft                              text    html    latex   example
  svm                               text    html    latex   example
 DONE (e1071)

DONE (INSTALL)
501# date
Tue Apr  3 09:05:37 PDT 2001
502#
#
On Tue, 3 Apr 2001, M. Edward (Ed) Borasky wrote:

            
The problem is in your netpbm installation, not in R.
#
> I can't seem to get the "e1071" package to build. Here is a Linux log; the
  > Windows version behaves the same way:
  > --------------------------------------------------------------------------
  > # R CMD INSTALL e1071*.gz
  > Installing source package `e1071' ...
  > creating cache ./config.cache
  > checking for library containing pnm_readpnm... no
  > checking for library containing pbm_readpbm... -lpbm
  > checking for library containing pgm_readpgm... -lpgm
  > checking for library containing ppm_readppm... -lppm
  > checking for library containing pnm_writepnm... -lpnm
  > updating cache ./config.cache
  > creating ./config.status
  > creating R/pnm.R
  > creating src/Makevars
  >  libs
  > gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
  >  -fPIC  -O2 -march=i386 -mcpu=i686 -c Rsvm.c -o Rsvm.o
  > gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
  >  -fPIC  -O2 -march=i386 -mcpu=i686 -c cmeanscl.c -o cmeanscl.o
  > gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
  >  -fPIC  -O2 -march=i386 -mcpu=i686 -c cshell.c -o cshell.o
  > gcc -I/usr/lib/R/include -I. -I/usr/local/include -mieee-fp -D__NO_MATH_INLINES
  >  -fPIC  -O2 -march=i386 -mcpu=i686 -c pnm.c -o pnm.o
  > In file included from /usr/include/pbm.h:7,
  >                  from /usr/include/pgm.h:7,
  >                  from /usr/include/ppm.h:7,
  >                  from /usr/include/pnm.h:7,
  >                  from pnm.c:19:
  > /usr/include/pbmplus.h:305:20: shhopt.h: No such file or directory
  > make: *** [pnm.o] Error 1

which version of netpbm have you installed? the pbmplus.h contained in
the debian linux stable package with version 19940301.2 does not have
a reference to shhopt.h in pbmplus.h ...

but anyway, that is beyond R's domain and certainly a bug in your
netpbm installation.
#
On 03-Apr-2001 M. Edward (Ed) Borasky wrote:
[snip]
You need to install the sshopt package because your installation of libgr
(which supplies libpbn ... libpnm) requires it. sshopt is a package for
parsing command line arguments.  I can't imagine why the dependency is
there (it certainly isn't on Red Hat 6.2) but that is an issue for your
distribution supplier.

Martyn
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On 03-Apr-2001 Friedrich Leisch wrote:
Netpbm is not installed.  On RedHat (and presumably other rpm-based
distributions) this functionality is provided in separate libraries,
all of which are contained in the package libgr.  The "no" above tells
you that netpbm isn't installed, so the configure script searches for
the individual libraries, and evidently finds them.

Martyn
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._