我正在尝试读取 R 中的文本头文件。除了以下内容,我已经非常成功:
该文件的一部分包含:
.
.
. (Other stuff)
spectra names = {
Endmember 1, Endmember 2, Endmember 3, Endmember 4, Endmember 5,
Endmember 6, Endmember 7, Endmember 8, Endmember 9, Endmember 10,
Endmember 11, Endmember 12, Endmember 13, Endmember 14, Endmember 15,
Endmember 16, Endmember 17, Endmember 18, Endmember 19, Endmember 20,
Endmember 21, Endmember 22, Endmember 23, Endmember 24, Endmember 25,
Endmember 26, Endmember 27, Endmember 28, Endmember 29, Endmember 30}
.
.
.
我希望输出是一个包含光谱名称的列表,即["Endmember 1" "Endmember 2"
等等......
我试过了read.csv()
,read.table()
但似乎没有任何效果。我被行尾和'{','}'字符难住了
我想做的是:从“光谱名称”开始阅读,然后将两者之间的所有内容存储{}
为字符串数组,如上所述。