qvalue and p.adjust functions
p.adjust can calculate adjusted p-values with different methods. I think you can choose Bonferroni correction and BH correction, for instance. BH correction gives you False Discovery Rate (FDR), which is one of the most commonly used I guess.

Q-value is different and cannot be calculated by p.adjust. The idea is that when you have many p-values to adjust, they form a distribution. If all p-values come from the null hypothesis, the p-value distribution is going to be uniform on [0, 1]. But usually, our p-values are a mixture of the null distribution and alternative distribution. The parameter $\pi_0$ describes the proportion of p-values (or tests) that comes from the null hypothesis. To calculated q-values, the algorithm first estimates $\pi_0$, then calculates the q-value.

Note that if you set $\pi_0=1$, which means that you believe all the p-values come from the null distribution, then q-value is equal to FDR.

I think most people do not know about the meaning and details of q-values and it might be sufficient to use BH procedure in most cases.