Grokbase Groups R r-help March 2002
FAQ
I'm trying to export an R (1.4.0 on linux) matrix to python
(+Pyclimate) via a binary file. The problem is
that while R writes by columns, python reads
by rows. For a 2D matrix, there is no problem:
writeBin writes vectors, so
writeBin(t(x)[1:length(x)],...) works fine.

But the objects I want to export are 3D arrays
(slice rasters of lat,lon for each time t).
One way is to use a loop over the
3rd dimension and transpose for each slice, but I've
been trying to do something more efficient avoiding the
loop. No luck by now, as changing dim(x) to c(dim(x)[2],
dim(x)[1]*dim(x)[3]) does not solve the problem.
Does anybody have any suggestion?

Thanks

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo at ija.csic.es



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

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupr-help @
categoriesr
postedMar 13, '02 at 10:57a
activeMar 13, '02 at 11:04a
posts2
users2
websiter-project.org
irc#r

2 users in discussion

Agustin Lobo: 1 post Martin Maechler: 1 post

People

Translate

site design / logo © 2017 Grokbase