petteriTeikari / R-PLR

Once separate repos combined to one making it easier in the end
1 stars 0 forks source link

numbers of columns of arguments do not match #5

Open petteriTeikari opened 5 years ago

petteriTeikari commented 5 years ago
 .. Removed total of " 92 " rows from Control Excel sheet
 .. Removed total of " 58 " rows from Glaucoma Excel sheet
 .. Removed total of " 78 " rows from Diabetes Excel sheet
 .. Removed total of " 96 " rows from Exceptional Cases (Neuro) Excel sheet
Error in rbind(deparse.level, ...) : 
  numbers of columns of arguments do not match

With "Ctrl+Alt+Enter" you do not get even exact line reference to your problem, but it means that you do not have the same columns in your Master Data sheets.

The traceback goes here:

6. stop("numbers of columns of arguments do not match") 
5. rbind(deparse.level, ...) 
4. rbind(comb1, df_diabetes2) at combine_excelDataFramesToOne.R#28
3. combine.excelDataFramesToOne(df_control, df_glaucoma, df_diabetes, 
    df_neuro, vars_to_keep) at read_theMasterExcel.R#40
2. read.theMasterExcel(masterXLS_data_path, XLS_filename) at import_computedFeats.R#9
1. import.computedFeats(data_path_feats, pattern_to_find, dataset_type, 
    masterXLS_data_path, XLS_filename) 

rbind joins the rows together, and expects there to be the same number

Added a warning part to highlight the problematic Sheets: https://github.com/petteriTeikari/R-PLR/commit/7485eccf648d65e4f347dddbfd8b600f5b5b0ed8

Your sheets are not the same length! Fix your Master Data Sheet!
  no of columns in Control sheet =  63 
  no of columns in Glaucoma sheet =  63 
  no of columns in Diabetes sheet =  62 
  no of columns in Neuro sheet =  62