How can I manually calculate the Bonferroni correction? I created a statistical model with one categorical factor with six levels and performed a posthoc test to obtain the significance level for every contrast (15 comparisons). I wonder if I should apply the Bonferroni correction to account for multiple comparisons.
Say that I have a vector named "p.values" with the 15 p-values obtained from the posthoc test:
0.9724 
0.0013 
0.1997 
0.9775 
0.1358 
0.0001 
0.0343 
1.0000 
0.0205 
0.4386 
0.0001
0.5586 
0.0422 
1.0000 
0.0259

Would it be correct to calculate the adjusted p-values as follows:
adj.p <- p.values/15 #(the number of comparisons)

bon.p.values <- round(1-(1-adj.p)^15,4)

Obtaining the following values:
0.6341 
0.0013 
0.1821 
0.6361 
0.1275 
0.0001 
0.0338 
0.6447 
0.0203 
0.3593 
0.0001
0.4341 
0.0414 
0.6447 
0.0256

Are these new p-values Bonferroni corrected?

No, unfortunately your correction formula is wrong.
The Bonferroni correction compares a test statistic's $p$ value out of $m$ hypotheses to a nominal $\alpha$ by checking whether
$$ p<\frac{\alpha}{m}. $$
Of course, you can alternatively modify the $p$ values rather than $\alpha$ and check whether
$$ mp<\alpha $$
(yes, the term on the left can be greater than one).
The Bonferroni correction is notoriously conservative. You may want to consider more powerful (but also more complicated) methods like Holm's stepwise or Šidák's procedure.
