ERROR 'x' must be an array of at least two dimensions

Hello.

I am continuously receiving the following error message when running the RemoveMissingByPercent function: “Error in colMeans(is.na(int.mat)) : ‘x’ must be an array of at least two dimensions”. It appears that for some reason my data is not being added into the mSet matrix properly and I am not sure how to fix this. This was previously working fine but last week began throwing this error. The full code to this point is below:

> mSet<-InitDataObjects("conc", "stat", FALSE, 150)  
Starting Rserve...
 "C:\Users\path..." 
[1] "MetaboAnalyst R objects initialized ..."
Warning message:
In Cairo::CairoFonts(regular = "Arial:style=Regular", bold = "Arial:style=Bold",  :
  CairoFonts() has no effect on Windows. Please use par(family="...") to specify the desired font - see ?par.
> mSet<-Read.TextData(mSet, "C:/Users/path.../metabolites.csv", 
+                     "rowu", "disc") 
> mSet$msgSet$read.msg
[1] "Samples are in rows and features in columns"                                  
[2] "The uploaded file is in comma separated values (.csv) format."                
[3] "The uploaded data file contains 116 (samples) by 965 (compounds) data matrix."
> mSet <- SanityCheckData(mSet)
[1] "Successfully passed sanity check!"                                                                             
[2] "Samples are not paired."                                                                                       
[3] "4 groups were detected in samples."                                                                            
[4] "Only English letters, numbers, underscore, hyphen and forward slash (/) are allowed."                          
[5] "<font color=\"orange\">Other special characters or punctuations (if any) will be stripped off.</font>"         
[6] "<font color=\"red\">Non-numeric values were found and replaced by NA.</font>"                                  
[7] "<font color=\"red\"> 25 features with a constant or single value across samples were found and deleted.</font>"
[8] ""                                                                                                              
[9] "A total of 30721 (28.2%) missing values were detected."                                                        
There were 26 warnings (use warnings() to see them)
> mSet <- RemoveMissingByPercent(mSet, percent=0.2) 
Error in colMeans(is.na(int.mat)) : 
  'x' must be an array of at least two dimensions 

Any help is appreciated!

This is always data dependent. It seems that “RemoveMissingByPercent” trimmed your data to one dimension (i.e. one row / one column left).

  1. You can try percent=0.1 to see if this helps.
  2. Your should view your data first.

Note in the web version, you can see summary of missing values and direct visualization