# Create a minimal dataset containing all required POS and NEG formulas
library(data.table)
demo_ideg <- data.table(
file_id = 1,
mf = c(
"C17H20O9", "C19H22O10", "C20H22O10", "C20H24O11", "C21H26O11", # NEG
"C13H18O7", "C14H20O7", "C15H22O7", "C15H22O8", "C16H24O8" # POS
),
i_magnitude = c(
1200, 900, 1500, 700, 800, # NEG intensities
2000, 1800, 2200, 1600, 1900 # POS intensities
)
)
calc_ideg(
mfd = demo_ideg,
mf_col = "mf",
magnitude_col = "i_magnitude",
grp = "file_id"
)
Run the code above in your browser using DataLab