在R中读取FORTRAN写入的双精度变量 [英] Reading FORTRAN-written double precision variables in R

查看:568
本文介绍了在R中读取FORTRAN写入的双精度变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含FORTRAN代码的双精度文件,格式为 x.yyyyD + zz 。当在R中使用read.csv时,R似乎不会将它们识别为浮点值。我是新来的

I have a file containing double precisions written from a FORTRAN code in the format of x.yyyyD+zz. When using read.csv in R, R does not seem to recognize those as floating point values. I'm new to R; what's the trick here?

推荐答案

使用 sed 或您最喜欢的文本编辑器将 D s更改为 E s,我希望 R 在您这样做之后,会愉快地阅读数字。

Use sed or your favourite text editor to change the Ds to Es, I expect R will happily read the numbers after you do that.

这篇关于在R中读取FORTRAN写入的双精度变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆