作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
以this file例如,我正在尝试读取 data.frame 中的数据。来自 the doc (pdf 文件,表 1),它遵循一些 fortran 约定。我尝试了以下但收效甚微:
dir <- "Uncompressed-files/"
file <- "01_hit09.par"
delim <- c("I2", "I1", "F12.6", "E10.3", "E10.3", "F5.4", "F5.4",
"F10.4", "F4.2", "F8.6", "A15", "A15", "A15", "A15", "6I1", "6I2",
"A1", "F7.1", "F7.1")
test <- read.fortran(paste0(dir, file), delim)
test <- read.fwf(paste0(dir, file),
c(2, 1, 12, 10, 10, 5, 5, 10, 4, 8,
15, 15, 15, 15, 6, 12, 1, 7, 7))
最佳答案
根据 ?read.fortran
:
"E"
不是受支持的格式。 "E"
至
"F"
并删除所有显式十进制格式:
file <- "01_hit09.par"
delim <- c("I2", "I1", "F12", "F10", "F10", "F5", "F5", "F10", "F4", "F8",
"A15", "A15", "A15", "A15", "6I1", "6I2", "A1", "F7", "F7")
(test <- read.fortran(file, delim, n=10))
read.fwf
:
test2 <- read.fwf(file, c(2,1,12,10,10,5,5,10,4,8,15,15,15,15,
rep(1,6),rep(2,6),1,7,7), as.is=TRUE)
关于读取 HITRAN 文件格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11091850/
以this file例如,我正在尝试读取 data.frame 中的数据。来自 the doc (pdf 文件,表 1),它遵循一些 fortran 约定。我尝试了以下但收效甚微: dir 0' 将
我是一名优秀的程序员,十分优秀!