[R] writing matrices (no subject)

Liaw, Andy andy_liaw at merck.com
Wed Jul 20 15:49:57 CEST 2005


Simply gooling for "writing ARFF file in R" gave the following as first hit,
which is right on the WEKA page:

Miscellaneous code
[...]
Function for reading ARFF files into the R statistical package (kindly
provided by Dr Craig Struble). 
Function for writing ARFF files from the R statistical package (kindly
provided by Nigel Sim). 
http://www.cs.waikato.ac.nz/~ml/weka/example_code/writearff.R

I have not tried it myself.

Andy

PS: AFAIK, ARFF is not a binary format, but simply csv with header
information.

> From: David Ruau
> 
> Thanks for your answers,
> I need to print this data frame into a .csv file to import it in WEKA.
> Do you have better solution?
> I quite a new user of WEKA I don't know if you can give it a binary 
> file. I think you can but it will be complicated...
> 
> David
> 
> On Jul 20, 2005, at 15:07, jim holtman wrote:
> 
> > You might have better luck if you have a loop that is processing one
> > row at a time.  That means you will have to determine what the
> > formatting should be.  With write.table it is trying to process the
> > entire array at once to determine the best formatting and 
> it taking a
> > lot of memory (my guess at least 500MB).
> >
> > What are you going to do with a text file that large?  Can you write
> > it out in binary if you are reading it in with another program?  If
> > you are going to reread it with R, then 'save' would be a better
> > choice.
> >
> > On 7/20/05, David Ruau <David.Ruau at rwth-aachen.de> wrote:
> >> Hi All,
> >>
> >> I want to print a square matrix of 7000 x 7000 into a text 
> file. But I
> >> got a error after few hours of computation...
> >> --------
> >>> write.table(MyDistMxDF, file = "temp.csv", sep=",", quote=F)
> >> *** malloc: vm_allocate(size=8421376) failed (error code=3)
> >> *** malloc[2889]: error: Can't allocate region
> >> Error: vector memory exhausted (limit reached?)
> >> *** malloc: vm_allocate(size=8421376) failed (error code=3)
> >> *** malloc[2889]: error: Can't allocate region
> >>>  q()
> >> *** malloc: vm_allocate(size=8421376) failed (error code=3)
> >> *** malloc[2889]: error: Can't allocate region
> >> *** malloc: vm_allocate(size=8421376) failed (error code=3)
> >> *** malloc[2889]: error: Can't allocate region
> >> Error in lazyLoadDBfetch(key, datafile, compressed, envhook) :
> >>         internal error in decompress1
> >>>
> >> ------
> >> I am running R 2.0.1 on MacOS X 10.3 with 1Gb ram.
> >> How could I write such a matrix to a text file.
> >>
> >> David
> >>
> >> ______________________________________________
> >> R-help at stat.math.ethz.ch mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide! 
> >> http://www.R-project.org/posting-guide.html
> >>
> >
> >
> > -- 
> > Jim Holtman
> >
> > What the problem you are trying to solve?
> >
> >
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>




More information about the R-help mailing list