Hi,
The netCDF will not have proper pos/neg annotated. If you KNOW
in which order they come, you can:
library(xcms)
library(faahKO)
# Assume that's one of yours:
file <- system.file('cdf/KO/ko15.CDF', package = "faahKO")
xposneg <- xcmsRaw(file)
# Vector of alternating pos/neg
polarity = rep(c("positive", "negative"), length=length(xposneg@scantime))
# Split into a list with two xcmsRaw objects:
xrs <- split(xposneg, f=polarity)
# Write out to new netCDF files
write.cdf(xrs[["positive"]], filename="xrpos.cdf")
write.cdf(xrs[["negative"]], filename="xrneg.cdf")
Repeat for all your files...
Yours,
Steffen