我正在使用GAUSS / Aptech进行计算,而我只是使用“保存”语法来保存结果。
然后将结果以 .fmt 格式保存。我猜必须有一些GAUSS的语法(或函数)可以将结果导出到.txt,但我找不到该语法(或函数)。
有什么功能可以读取R中的 .fmt 文件吗?
最佳答案
已经很长时间了,但是我遇到了同样的问题,并从APTECH forum中找到了以下代码,它们可以完美运行。
希望这可以帮助任何人。
假设您在名为my_variable.fmt的文件中有一些数据,
您要保存名为my_xls_file.xls的文件。您可以
像这样完成:
//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文件,请使用输出功能和
打印功能如下:
//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;
关于r - 如何将.fmt文件转换为.txt文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22911073/