how to solve “dim(X) must have a positive length” at running ComBat function in R
batch = Pheno_LMS$batchId should be batch = Pheno_LMS$BatchId, if you fix that then at least the code you showed works just fine.