Hi, I'm quite new to R and currently trying to use lm to fit linear models but I am currently stuck my code is as follows: Model1 = function(meth_matrix,exposure, X1, X2, X3, batch) { mod = lm(meth_matrix[, methcol]~exposure+X1+X2+X3+batch) res = summary(mod)$coef[2,] system.time(indiv.results <- mclapply(setNames(ncol=473864(cord_betas)), dimnames(cord_betas)[[2]]), Model1, meth_matrix=cord_betas, exposure=filtered_pheno, X1=covariates$k032, X2=covariates$k021, X3=covariates$kz029, batch=pdata.B1221.cord$BCDPlate)) } I am not sure if this will make any sense or if you need any more information? Any help or guidance would be massively appreciated. Best wishes Jessica Timms [[alternative HTML version deleted]]