Dear R-Team,
I have a problem with writing an array to (for example) a .txt-file.
Because of the .txt-file must be read from another programm (OPL ILOG),
the syntax of the output must be from a special form:
name_of_the_object = [ [1,2, ... ],
[1,...],
... ];
I think it's easier to understand with a small example:
X<-array(1:4,c(2,2))
should be written as:
X = [[1,3],
[2,4]];
I have (until now) used the following:
write("X=[[",file=filename)
write.table(X,file=filename,sep=",",eol="],\n [", row.names=FALSE,
col.names=FALSE,append=TRUE)
which leads to the following output:
X=[[
1,3],
[2,4],
[
I hope you can help because it's very annoying to adjust the resulting
.txt-file "by hand".
Thanks a lot for your help!
With nice greetings
Andreas Gegg,
mathematic-student on Catholic University of Eichstätt-Ingolstadt (Germany)
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.