Question: ```
for(i in 1:32)
{
  columns <- data.frame(names(data_anova_tr[i]))
  bartletsrez <- (bartlett.test(data_anova_tr[,i]~data_anova_tr$Treatment_str))
  bart_pval <-cbind(data.frame(bartletsrez$p.value),columns)
}

```

The for loop I m trying to run up here is only saving the value from the last column (results of the bartlett test p val). How can I make sure it records every single value ([i]th val).

Answer: 
As pointed out by @camille, you should increment `bart_pval` instead of re-assigning it at each iteration.

So, modifying your code like that should solve your issue:

```r
bart_pval <- NULL
for(i in 1:32)
{
  columns <- data.frame(names(data_anova_tr[i]))
  bartletsrez <- (bartlett.test(data_anova_tr[,i]~data_anova_tr$Treatment_str))
  bart_pval <-cbind(bart_pval,data.frame(bartletsrez$p.value),columns)
}

```
You don't need the loop. Something like this should work:

```
cols <- colnames(data_anova)[1:32]  # You only need [1:32] if there are more than 32 cols
pval <- sapply(1:32, function(i) bartlett.test(data_anova_tr[,i]~data_anova_tr$Treatment_str)$p.value)
bart_pval <- data.frame(cols, pval)

```