I have a data set consisting of several Types and two treatments (example below). I am using the lm() function in R to analyze it and emmeans for post hoc tests.
m <- lm(Y ~ Type*Treatment)
Anova(m, type = 3)
How do I set up orthogonal contrasts in R? If I run
emmeans(m, ~Type*Treatment)
it compares everything. I am interested in comparing different Treatments within Type and different Types within Treatments but not different Treatments and different Types. In other words, I would like to compare Treated A vs. Untreated A, or Treated A vs. Treated B, but not Treated A vs. untreated B.
I am sorry if this is covered under another question. I have searched the forums and haven't found anything that I can apply to this situation. Thank you.

To figure out whether theses test are really what you want to test, I'd kindly ask you to ask this question with more background on stats.stackexchange.com .
Reproducible example:
Created on 2021-10-07 by the reprex package (v2.0.1)