我正在使用 GAUSS/Aptech 进行计算,我只是使用“保存”语法来保存结果。
然后结果以.fmt格式保存。我猜一定有一些GAUSS的语法(或函数)可以将结果导出到.txt,但我找不到该语法(或函数)。
R中有读取.fmt文件的函数吗?
小智 0
已经很长时间了,但我遇到了同样的问题,并从APTECH 论坛找到了以下运行完美的代码。
希望这可以帮助任何人来。
假设您在名为 my_variable.fmt 的文件中有一些数据,并且您希望将其保存在名为 my_xls_file.xls 的文件中。你可以这样完成:
Run Code Online (Sandbox Code Playgroud)//load the matrix from the .fmt file load my_variable; //write it to an Excel file xlsWrite(my_variable, "my_xls_file", "A1", 1, "");要将数据写入 .txt 文件,请使用输出函数和打印函数,如下所示:
Run Code Online (Sandbox Code Playgroud)//load the matrix from the .fmt file load my_variable; //set output to print to 'my_txt_file.txt' //(reset means if the file exists write over it) output file=output.txt reset; //print 'my_variable' sending output to //the screen and 'my_txt_file.txt' print my_variable; //turn output to file off so no more //print statements go to this file output off;