diff --git a/R/as.ftmsData.R b/R/as.ftmsData.R index a060d7c..d74f4c6 100644 --- a/R/as.ftmsData.R +++ b/R/as.ftmsData.R @@ -92,11 +92,11 @@ as.peakData <- function(e_data, f_data, e_meta, edata_cname, fdata_cname, mass_c aroma_cname = NULL, modaroma_cname = NULL, dbe_cname = NULL, dbeo_cname = NULL, dbeai_cname = NULL, elcomp_cname = NULL, instrument_type = "12T", data_scale = "abundance", check_rows = FALSE){ - - # check that e_data, f_data, and e_meta are data.frames # - if(!inherits(e_data, "data.frame")) stop("e_data must be of the class 'data.frame'") - if(!inherits(f_data, "data.frame")) stop("f_data must be of the class 'data.frame'") - if(!inherits(e_meta, "data.frame")) stop("e_meta must be of the class 'data.frame'") + + # make sure e_data, f_data, and e_meta are data.frames # + e_data <- as.data.frame(e_data) + f_data <- as.data.frame(f_data) + e_meta <- as.data.frame(e_meta) # check that the peak column exists in e_data and e_meta (if applicable) # if(!(edata_cname %in% names(e_data))) stop(paste("Peak/Mass column ", edata_cname," not found in e_data. See details of as.peakData for specifying column names.", sep = ""))