hoping for a bit of help with something that should (hopefully) be easy enough for those with the knowledge.
I am working with a dataset with 111 columns and 300 rows. The first 70 columns are control data, columns 71-111 contain data on people with diabetes. I have performed the following t-test on the first row:
row1 <- data[1:1,]
control_cols <- c(1:70)
control <- row1[control_cols]
diabetes_cols <- c(71:111)
diabetes <- row1[diabetes_cols]
t.test(control, diabetes, mu=0, paired = F, conf.level=0.95)
Is there a way than I can use the apply function to automate this to perform the t-test on each row, so that I can see the p-values of each row individually?