For questions that are well asked, there won't be a dilemma. This one wasn't, and should not have been answered at all. But if you look at better questions on the site (I would say higher-rated, but you have to consider that older questions were held to a different standard), you'll find that they overwhelmingly don't have this problem - because the requirements for a good question more or less prevent the problem from coming up.
"R newbie asking about loops" isn't a suitable question title, because it doesn't allow anyone to search for the question. It's talking about the OP rather than the question. It doesn't describe the question in any meaningful sense. It's not even evident whether the question should be a "how do I do X?" question or a "why did Y happen?" question (the two main categories that encompass almost every valid question).
We can't answer "can anyone help with a loop for the above command?", because that is not a proper question. It doesn't tell us what kind of help is needed.
The question also suffers from the classic problem of being confused between the two categories I outlined above.
If it's intended to be "how do I write this loop?", then the existing attempt is not relevant. What we need is a clear description of what problem needs to be solved. If it's about how to make a loop for this situation, then it should explicitly say that - but it also needs to explain what "this situation" is, in a searchable manner. If it's about a technique for analyzing code and producing the corresponding loop, similarly that needs to be made explicit, and focused enough that an answer can be written.
But if it's a how-to question, it's one of those and not the other. And as such, there is no problem choosing how to write the answer. The code-seeking question gets code; the technique-seeking question gets a technique.
On the other hand, if the overall question is intended to be "what's wrong with this attempt at the loop", then we simply don't accept "here's my attempt; it didn't work". We don't provide a debugging service, and we expect a specific question. That starts with the OP being responsible for analyzing what happened when the code was tried, beyond just "it didn't work"; proceeding to follow standard debugging steps, and finally producing a proper MRE of the problem so that a concrete question about that problem can actually be asked.
As it happens, the question was closed as a duplicate of a better-written, but still far from ideal question. At least here we can see a clear description of the problem, and a clear explanation of what went wrong with the attempt (although the question should still have only one of those things). We also see a title that concisely summarizes the problem: "subset multiple data frames based on the same condition". Ideally, that question would be edited; or perhaps someone could prepare a self-answered version that asks is properly, and everything else can be dupe-hammered there. (It's a well-known problem that the people who need this kind of information, lack the perspective required to ask the question properly.)