library(ftmsRanalysis)
data("ftms12T_edata")
data("ftms12T_fdata")
data("ftms12T_emeta")
edata <- ftms12T_edata
edata[edata == 0] <- NA
peakObj <- as.peakData(edata, ftms12T_fdata, ftms12T_emeta,
edata_cname="Mass", fdata_cname="SampleID",
mass_cname="Mass", c_cname="C", h_cname="H",
o_cname="O", n_cname="N", s_cname="S",
p_cname="P", isotopic_cname = "C13",
isotopic_notation = "1", check_rows = T)
Error in if (any(molfilt$Num_Observations == 0)) res <- applyFilt(molfilt, :
missing value where TRUE/FALSE needed
which then calls n_present(), which calls rowSums() on an object with NA's producing NA's in the output:
Then the any() call in the error message returns an NA since molfilt$Num_Observations contains NA's.
The below fails
The error appears to begin with the molecule_filter() call:
ftmsRanalysis/R/as.ftmsData.R
Line 291 in 13634ad
which then calls n_present(), which calls rowSums() on an object with NA's producing NA's in the output:
ftmsRanalysis/R/group_summary_functions.R
Line 12 in 13634ad
Then the any() call in the error message returns an NA since molfilt$Num_Observations contains NA's.