Thank you all for your kind answers.
Among others, Both Andy and Tim suggested .C() and .Call() routines. Gamal
provided me a quite detailed solution, using write.table() first and reading
the text output file from C later. In addition, Tim and Bill mentioned the
Connect/C++ library. (Unfortunately, I didn't find this library in my S-Plus
6.1 professional yet.)
I am quite new in this kind of programming. I have to try more. Thank you
again!
-----Original Message-----
From: Yingfu Xie [mailto:Yingfu.Xie@sekon.slu.se]
Sent: den 26 april 2004 10:25
To: 's-news@lists.biostat.wustl.edu'
Subject: [S] export a list to an array in C/C++
Hello, Dear users,
I have a list in S-plus 6.1 under Win2000, each element of which is a matrix
with different dimension; and I want to use it in C. The only way I can do
now is to unlist it to a vector, export to an ASCII file and read it again.
But it takes time and is error prone. Does anyone have better ideas, ideally
exporting this list (or after converting to an array in S-plus then
exporting) to a 3-dimension array[][][] in C?
A lot of thanks in advance!
Regards,
Yingfu
###########################################
This message has been scanned by F-Secure
Anti-Virus for Microsoft Exchange.
###########################################
|