Correction to: Nature Medicine https://doi.org/10.1038/s41591-023-02761-2, published online 30 January 2024.

In the version of the article initially published, in the “Dietary intervention alters lymphoid composition” section, the sentence “The vegan diet was high in dietary fiber and dietary sugars as compared with the ketogenic diet” previously read “…and low in dietary sugars”. Additionally, in Extended Data Fig. 1e, the order and color of the bars representing sugar were switched. These errors have now been corrected in the HTML and PDF versions of the article.