I'd like to know where on Stack Exchange I should ask about how to use a specific hypothesis test on R and where to ask if my code tests do what I would like to without theoretical foundation.
There are two components to what you want to know.
- Which statistical test is appropriate for your specific problem?
- How to write code to carry out the desired statistical test?
Question (1) is on-topic here, because it is about statistics.
Question (2) is off-topic here, because it is solely about writing code. Depending on the nature of the programming problem you face, there are several sites that could be a good fit. You'll need to read the Help Center for each and make a choice about which site is best.