I am trying to read text header files in R. I have been pretty successful except for the following:
One part of the file contains:
.
.
. (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}
.
.
.
I want the output to be a list containing the names of the spectra, i.e. ["Endmember 1" "Endmember 2"
and so on...
I tried read.csv()
, read.table()
, but nothing seems to work. I am stumped by the ends of the lines and the '{', '}' characters
What I want to do is: start reading at "spectra names" and then store everything between the {}
as an array of strings as I mentioned above.